today I got a bit confused about date attributes in CoreData:
On one hand, the documentation of NSAttributeDescription states that
the attribute values are NSDate objects. On the other hand using
"Copy method implementations to clipboard" in XCode 2.1 on a date
attribute creates the following accessor methods which expect
NSCalendarDate objects:
Actually, when fetching an object from an SQLite store, all date
attributes contain NSDate objects event if they were once inserted
using NSCalendarDate objects.
In my app I currently need NSCalendarDate objects for my date
attributes because I have a load of calculation categories for this
class.
I tried [NSAttributeDescription
_setAttributeValueClassName:@"NSCalendarDate"] on my date attributes
at model load time which led to funny exceptions.
The only solution I have found so far is to convert all fetched
NSDates into NSCalendarDates in the awakeFromFetch method:
But this has the downside of slowing down the fetch process. (Yes, I
know this code can be optimized :-) )
So does anybody know a better way to make CoreData instantiate
NSCalendarDate objects at fetch time?
Cheers
Frank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden