McPragma
McPragma

Reputation: 91

UIPasteboard Puzzle

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.

Upvotes: 3

Views: 883

Answers (1)

kennytm
kennytm

Reputation: 523284

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

Upvotes: 2

Related Questions