Derived Value and Core Data
Derived Value and Core Data
- Subject: Derived Value and Core Data
- From: Luther Baker <email@hidden>
- Date: Fri, 13 Nov 2009 13:27:27 -0600
Using Core Data - I have created a named NSManagedObject that has both a
start time and end time.
In an iphone app (UITableViewController), I'd like to display a list of
these *Sessions* and I'd like the SECTION headers to break per day, based on
a Session's start *date*. So, I'm storing a *time* - and I need to group by
a *date*.
Would I simply add a readonly property 'startDate' to the literal Session
code (.h,.m) that Core Data generated from my data model - in which I would
derive the start date from the start time? or would this be a case for
declaring a 'transient' property in my Core Data model? I don't exactly know
when to use or not to use Transient properties.
It would be used as follows:
fetchedResultsController_ =
[[NSFetchedResultsController alloc]
initWithFetchRequest:fetchRequest
managedObjectContext:managedObjectContext_
sectionNameKeyPath:@"startDate"
cacheName:cacheName];
Will this manually defined property actually work in this method? I've
created a transient property in my Core Data model and implemented my own
getter for the property but I only ever get back the 'default' value I
created in the Core Data model gui. In other words, the infrastructure never
seems to invoke my version of
- (NSString*)startDate {
...
}
implemented in the code-gen'd Session (NSManagedObject) class.
What is the proper way to do this?
-Luther
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden