问题
I need to store information on application that always need to be read when open application. But I don't want user copy/dump/or edit it. So the question is : "Is UIPasteboard can solve this problem?" is it security? and if not, what else is suitable to use.
Thank you very much.
Edit: Is there have other solution that can solve "delete and reinstall application?"
回答1:
UIPasteboard can be overwritten at any time, and I wouldn't call it secure.
You might want to consider encrypting and serializing the data. Then when you need to access it, decrypt it and read it into memory.
回答2:
The use of pasteboard does not seem the right direction for your problem. You should more likely communicate with a server and use the method identifierForVendor
from UIDevice.
But if you are sure a pasteboard is what you need, look at the concept of named pasteboards. In your context, the following method seems appropriate: + (UIPasteboard *)pasteboardWithUniqueName // An application pasteboard object with a unique name.
Note that by default, this kind of pasteboard exists only until the app is open. Look at the persistent
property if you want to change this behavior.
Maybe (not tested), the system keeps it even if you delete / reinstall the app.
来源:https://stackoverflow.com/questions/10907849/uipasteboard-security