Re: CoreData: Getting the last object of a relation
Re: CoreData: Getting the last object of a relation
- Subject: Re: CoreData: Getting the last object of a relation
- From: George Orthwein <email@hidden>
- Date: Mon, 19 Jun 2006 02:31:02 -0400
1. [self valueForKeyPath:@"transactions.@lastObject"] -> doesn't
work, because
CoreData doesn't know "@lastObject".
Does anything know "@lastObject"? ;)
@ denotes a collection operator, so it would have to be listed on
this page:
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueCoding/Concepts/ArrayOperators.html
I think you'll probably need to add an additional attribute in the
model. Either a lastInserted that you can set for the last inserted
(and clear the previous) or you could number the inserts with an ID
and you'll know the last inserted by the highest ID.
Also, if this can (or should) be moved to the controller layer then
there are probably other options....
Hope that helps,
George
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden