• 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
Silly, can I use @max to get the object with the latest date?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Silly, can I use @max to get the object with the latest date?


  • Subject: Silly, can I use @max to get the object with the latest date?
  • From: Gustavo Pizano <email@hidden>
  • Date: Sun, 15 May 2011 12:02:16 +0200

Hello all.

I have a Entity A	 that has a to-many relationship. to B

Now I need to get the latest B of A.

I was reading NSFetchRequest, and NSPredicate, for NSPredictate I could use something like

 predicate = [NSPredicate predicateWithFormat:@"birthday > %@", referenceDate];
filteredArray = [array filteredArrayUsingPredicate:predicate];

but the operator is a comparison,  I wish to know if its possible to fetch the object with he latest date without having to looping through the objects manually and comparing the dates.

And NSFetchRequest will fetch me on the whole table of B.


I know its silly question but I hadn't found the way..

thanks


Gustavo

_______________________________________________

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

  • Follow-Ups:
    • Re: Silly, can I use @max to get the object with the latest date?
      • From: Evadne Wu <email@hidden>
  • Prev by Date: Re: create an autorelease pool in the init-method and release it in the dealloc-method ..?
  • Next by Date: Re: Silly, can I use @max to get the object with the latest date?
  • Previous by thread: Re: Tab Bar Application
  • Next by thread: Re: Silly, can I use @max to get the object with the latest date?
  • Index(es):
    • Date
    • Thread