Peter Lapisu
Peter Lapisu

Reputation: 20975

Core data encrypted attributes

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

Answers (1)

ksh
ksh

Reputation: 1904

You actually can implement custom accessor methods, read up this apple doc.

Upvotes: 2

Related Questions