Objective c 核心数据加密属性
我们希望加密实体的某些属性,但仍然能够使用该属性执行抓取和谓词,而无需特别注意谓词等 人员属性名称已加密Objective c 核心数据加密属性,objective-c,cocoa,core-data,encryption,Objective C,Cocoa,Core Data,Encryption,我们希望加密实体的某些属性,但仍然能够使用该属性执行抓取和谓词,而无需特别注意谓词等 人员属性名称已加密 NSPredicate * predicate = [NSPredicate predicateWithFormat:@"name like JOHN"]; johns = [persons filteredArrayUsingPredicate: predicate]; 核心数据实体 .h @interface Person : NSManagedObject @property (n
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
- 我无法将@dynamic更改为@synthesis并实现我的自定义setter和getter
- 我可以将加密属性更改为c_name,并添加一个带有自定义getter和setter的合成属性名,但这在谓词上不起作用