###coredata 增删改查
//删除,修改,添加,都需要同步数据
//查询无需同步数据
####coreData插入
Employee *employee = [NSEntityDescription insertNewObjectForEntityForName:@"Employee" inManagedObjectContext:self.context];
employee.name = [NSString stringWithFormat:@"wangwu%u",(unsigned)i];
[self.context save:nil];
####CoreData 查询
//1.1:FectchRequest 抓取请求对象
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Employee"];
//1.2:设置过滤条件
NSPredicate *pre = [NSPredicate predicateWithFormat:@"name = %@",@"张三"];
request.predicate = pre;
//1.3执行查询请求
NSArray *emps = [self.context executeFetchRequest:request error:nil];
####coredata删除
//1:先查询到需要删除的数据(比如这里以删除员工张三的数据为例)
同CoreData 查询
//2:执行删除操作
[self.context deleteObject:emp];
//3:保存
[self.context save:nil];
####coredata修改
//1:先查询到需要删除的数据(比如这里以删除员工张三的数据为例)
同CoreData 查询
//2更新数据
emp.height = @3;
//3:保存
[self.context save:nil];