我们希望加密我们实体的某些属性,但仍然能够使用该属性执行提取和谓词,而无需特别注意谓词等...
人员属性名称已加密
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"name like JOHN"];
johns = [persons filteredArrayUsingPredicate: predicate];
核心数据实体
·H
@interface Person : NSManagedObject
@property (nonatomic, retain) NSString * name; // crypted
@property (nonatomic, retain) NSString * description; // crypted
@property (nonatomic, retain) NSString * someAtrribute;
@end
的.m
@implementation File
@dynamic name;
@dynamic description;
@dynamic someAttribute;
@end