开发者

UIPasteboard Puzzle

When using the code

[[UIPasteboard generalPasteboard] setString:@"mung"];
NSLog(@"%@", [UIPasteboard generalPasteboard].string);
开发者_Go百科

the console reports the new value of the string, but typing command-V in another application shows the previous pasteboard contents (which may be nothing).

Is there a reliable way to save a single string for use in another application?

Please advise. Thank you.


The simulator's UIPasteboard (accessed via the menu controller, processed by pasteboardd) is independent from the host's NSPasteboard (accessed via Cmd+C/V, processed by /usr/sbin/pboard).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜