In my Core Data model I have a property which is a NSDate, the user can change it and it is optional. I would like to set this property's default value as today, I saw no way to do this in the Core Data Model so I subclassed NSManangedObject and added this code to the implementation file.
- (NSDate *)date {
return [NSDate date];
}
This seemed to work however the Date is always todays date, even when the user changes it, it goes back to today. And if an object was created yesterday it will change the date to today, so that all the objects date will be today.
How do I get around this, do the default date is today by the user can still change it?