在 iPhone 模拟器上模拟数据保护
我正在尝试研究 iPhone 模拟器上的数据保护过程,但我在第一步失败了。我创建了一个数据库文件并将其添加到应用程序资源中。在应用程序启动期间,我将此文件复制到应用程序文件夹。
然后我这样做:
NSDictionary *fileAttributes = [NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey];
if (![[NSFileManager defaultManager] setAttributes:fileAttributes ofItemAtPath:appDBPath error:&error]) {
//handle error
}
但是当我检查文件属性后,我没有得到密钥 NSFileProtectionKey
我是否遗漏了一些明显的东西?我们是否必须添加任何数据保护框架?
还是只能在设备上测试?
我需要尽快完成它..请帮助我:(
I am trying study the Data Protection Process on iPhone Simulator, but i am failing at the initial step.I created a DB File and added it to the Application Resources. During the Application Launch i copy this file to the Application Folder.
Then i do this:
NSDictionary *fileAttributes = [NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey];
if (![[NSFileManager defaultManager] setAttributes:fileAttributes ofItemAtPath:appDBPath error:&error]) {
//handle error
}
But when i check the file attributes after this, i do not get the key NSFileProtectionKey
Am i missing something obvious in it? Do we have to add any Framework for Data Protection?
Or is it that this can only be tested on the device?
I need to get it done quickly.. Please help me guys :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论