Persistence on my UIP card remains active when the application is deleted. What for?

I use the UIPasteboard class to use data using the Sessions application. The document says persistence is deleted when the developer application is deleted. I am making two applications, one for copying and one for the past:

creator:

 -(IBAction)paste:(id)sender{ UIPasteboard* pb = [UIPasteboard pasteboardWithName:@"mytext" create:YES]; tv_pasting.text = pb.string; } 

reading application:

 -(IBAction)copy:(id)sender{ UIPasteboard* pb = [UIPasteboard pasteboardWithName:@"mytext" create:YES]; pb.persistent = YES; pb.string = tf_copy.text; } 

I make a text copy in my first application, I paste my second application, the text is copied, everything is fine. After that, I will uninstall the two applications and reinstall the reader application. I insert ... and the old copy is still available. Why?

+6
source share
1 answer

After some tests, I found that he deleted UIPasteBoard if his name has a link with the application package identifier.

So if my package id

 com.test.MyTestApp 

UIPasteBoard name must be

 @"com.test.MyTestApp.MyPasteBoard" 

Then it will be deleted. This is what tested me.

+5
source

Source: https://habr.com/ru/post/905096/


All Articles