Reputation: 20975
we want to encrypt some attributes of our entity, but still be able to perform fetches and predicates using the attribute, without the special care for predicates and etc...
person attribute name is encrypted
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"name like JOHN"];
johns = [persons filteredArrayUsingPredicate: predicate];
core data entity
.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
Upvotes: 1
Views: 331