• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData: Getting the last object of a relation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CoreData: Getting the last object of a relation
      • From: email@hidden
References: 
 >CoreData: Getting the last object of a relation (From: email@hidden)

  • Prev by Date: Re: Strategy for read only Templates with Core Data
  • Next by Date: Core Data validation question
  • Previous by thread: CoreData: Getting the last object of a relation
  • Next by thread: Re: CoreData: Getting the last object of a relation
  • Index(es):
    • Date
    • Thread