I am trying to add plain text to iPhone Pasteboard. The following code does not work:
UIPasteboard *pboard = [UIPasteboard generalPasteboard]; NSString *value = @"test"; [pboard setValue: value forPasteboardType: @"public.plain-text"];
I assume the problem is with an argument of type PasteBoard. Passing @"public.plain-text" nothing happens. By kUTTypePlainText , the compiler complains about an incompatible pointer type, but not a failure, and nothing happens. Using kUTTypePlainText also seems to require binding to MobileCoreServices , which is not mentioned in the docs.
ios copy-paste cocoa-touch uipasteboard
Luís Marques
source share