用代码给 core data property 设置默认值

 overrides NSManagedObject’s awakeFromInsert: method.

- (void)awakeFromInsert {

[super awakeFromInsert];
[self setValue:[NSDate date] forKey:@"myDate"];
}

你可能感兴趣的:(用代码给 core data property 设置默认值)