FYI - my managedObject is defined as such: @interface Note : NSManagedObject { }
@property (nonatomic, retain) NSNumber * uid; @property (nonatomic, retain) NSString * category; @property (nonatomic, retain) NSNumber * isEncrypted; @interface Note (CoreDataGeneratedPrimitiveAccessors) - (NSString *)primitiveCategory; - (void)setPrimitiveCategory:(NSString *)value; @end @implementation Note @dynamic uid; @dynamic category; @dynamic isEncrypted; - (NSString *)category { NSString * tmpValue; [self willAccessValueForKey:@"category"]; tmpValue = [self primitiveCategory]; [self didAccessValueForKey:@"category"]; if ([[self valueForKey:@"isEncrypted"] boolValue]) { //code to decrypt tmpValue } return tmpValue; } - (void)setCategory:(NSString *)value { if ([[self valueForKey:@"isEncrypted"] boolValue]) { // code to encrypt tmpValue } [self willChangeValueForKey:@"category"]; [self setPrimitiveCategory:value]; [self didChangeValueForKey:@"category"]; } - (BOOL)validateCategory:(id *)valueRef error:(NSError **)outError { // Insert custom validation logic here. return YES; } _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com