Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The persistancy on my UIPasteboard is still active when the app is uninstalled. why?

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 ?

like image 294
Anthony Avatar asked Jan 04 '12 13:01

Anthony


1 Answers

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.

like image 81
delannoyk Avatar answered Nov 15 '22 09:11

delannoyk