Core data 数据分开存储 并简单加密
来源:互联网 发布:华为t8300数据恢复 编辑:程序博客网 时间:2024/05/10 05:17
if (persistentStoreCoordinator_ != nil) {
return persistentStoreCoordinator_;
}
persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc]➥
initWithManagedObjectModel:[self managedObjectModel]];
{
NSURL *passwordStoreURL = [NSURL fileURLWithPath: [[self➥
applicationDocumentsDirectory] stringByAppendingPathComponent: @"Passwords.sqlite"]];
NSError *error = nil;
if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType➥
configuration:@"Passwords" URL:passwordStoreURL options:nil error:&error]) {
NSLog(@"Unresolved error with password store %@, %@", error, [error userInfo]);
abort();
}
//加密
NSDictionary *fileAttributes = [NSDictionary➥
dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey];
if(![[NSFileManager defaultManager] setAttributes:fileAttributes➥
ofItemAtPath:[passwordStoreURL path] error: &error]) {
NSLog(@"Unresolved error with password store encryption %@, %@", error, [error➥
userInfo]);
abort();
}
}
{
NSURL *notesStoreURL = [NSURL fileURLWithPath: [[self ➥
applicationDocumentsDirectory] stringByAppendingPathComponent: @"Notes.sqlite"]];
NSError *error = nil;
if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType➥
configuration:@"Notes" URL:notesStoreURL options:nil error:&error]) {
NSLog(@"Unresolved error with notes store %@, %@", error, [error userInfo]);
abort();
}
}
return persistentStoreCoordinator_;
}
- Core data 数据分开存储 并简单加密
- Iphone数据存储Core Data的简单使用
- iOS 数据存储 - Core Data
- iOS数据存储--Core Data
- Core Data数据持久性存储基础教程
- Core Data数据持久性存储基础教程
- Core Data数据持久性存储基础教程
- iphone 数据存储--Core-Data的使用
- iphone 数据存储--Core-Data的使用
- Core Data数据持久性存储基础教程
- Core Data存储自定义类型数据
- IOS数据存储之---Core Data
- IOS 数据存储之 Core Data详解
- iOS开发之Core Data数据存储
- Core Data数据持久性存储基础教程
- IOS 数据存储之 Core Data详解
- IOS 数据存储之 Core Data详解
- [ios开发基础之 Core Data [1] ]Core Data数据持久性存储基础教程
- Wince下设定线程的优先级 总结
- 第一次输入用二维字符数组,贴一下代码
- Windows CE 6.x驱动程序的新特性
- fork函数
- 安卓第三方接入登陆-新浪登陆
- Core data 数据分开存储 并简单加密
- WINCE6模块的安全性----签名/证书
- 黑马程序员_IO流
- WINCE6.0 180天试用结束解决办法
- Iframe的缺点
- Windows Form Tips: 无边框窗口实现用鼠标拖拽的功能
- cc2530 串口实验4--设置时间
- 针对WinCE6.0下繁多的补丁包该怎么打及WinCE6.0 R3安装步骤
- 致自己