views:

157

answers:

1

When using the code

[[UIPasteboard generalPasteboard] setString:@"mung"];
NSLog(@"%@", [UIPasteboard generalPasteboard].string);

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.

A: 

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).

KennyTM