开发者

UIPasteboard Puzzle

开发者 https://www.devze.com 2022-12-17 07:06 出处:网络
When using the code [[UIPasteboard generalPasteboard] setString:@\"mung\"]; NSLog(@\"%@\", [UIPasteboard generalPasteboard].string);

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

精彩评论

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