One Quickie


Setting computed default value for a managed object (Core Data->General)
Make a subclass of NSManagedObject and override awakeFromInsert:
- (void) awakeFromInsert
{
    [super awakeFromInsert];

    NSDate *date = [NSDate date];

    [self setValue: date  forKey: @"when"];

} // awakeFromInsert



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com