I use the UIPasteboard
class to use data with severals app. The doc say that the persistancy is removed when the creator application is uninstalled. I do two app, one for copy, the other for past:
creator app:
-(IBAction)paste:(id)sender{
UIPasteboard* pb = [UIPasteboard pasteboardWithName:@"mytext" create:YES];
tv_pasting.text = pb.string;
}
reader app:
-(IBAction)copy:(id)sender{
UIPasteboard* pb = [UIPasteboard pasteboardWithName:@"mytext" create:YES];
pb.persistent = YES;
pb.string = tf_copy.text;
}
I do a text copy in my first app, I paste on my second app, the text is copied, all is good. After, I uninstall my two app and reinstall the reader app. I do paste... and the older copy is still available. Why ?
After some tests, I found that It removed the UIPasteBoard if the name of it has a link with the bundle identifier of the App.
So if my bundle identifier is
com.test.MyTestApp
the UIPasteBoard name should be
@"com.test.MyTestApp.MyPasteBoard"
Then it will be removed. This is what testing tought me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With