Skip to content

Instantly share code, notes, and snippets.

@ariok
Created December 16, 2013 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariok/7991569 to your computer and use it in GitHub Desktop.
Save ariok/7991569 to your computer and use it in GitHub Desktop.
Setter method for NSManagedObject subclass properties.
// This assumes we have an NSManagedObject with the NSDate* date property
- (void)setDate:(NSDate *)date{
[self willChangeValueForKey:@"date"];
[self setPrimitiveValue:date forKey:@"date"];
[self didChangeValueForKey:@"date"];
//If needed
//[self updateOtherData];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment