• 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: Finding the largest value in an NSTreeController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the largest value in an NSTreeController?


  • Subject: Re: Finding the largest value in an NSTreeController?
  • From: "I. Savant" <email@hidden>
  • Date: Sat, 31 May 2008 15:05:58 -0400

Well, I would have thought so, but I don't know enough about CoreData to actually get at the objects without the tree controller. I would've thought I could do that just off the tree controller, using @max, too.

1 - Create a fetch request for your desired entity.
2 - Create a sort descriptor for the key whose max value you're interested in.
3 - Set the fetch request's sort descriptor to the above.
4 - Create any predicates needed for filtration (ie, whatever you may or may not have used in the tree controller).
5 - Set the fetch request's predicate to the above if any.
6 - Execute the fetch request and get the last (or first) object of the results (checking for errors, minding the set-versus-array gotchas, etc.).


--
I.S.



_______________________________________________

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: Finding the largest value in an NSTreeController?
      • From: Rick Mann <email@hidden>
References: 
 >Finding the largest value in an NSTreeController? (From: Rick Mann <email@hidden>)
 >Re: Finding the largest value in an NSTreeController? (From: Jonathan Dann <email@hidden>)
 >Re: Finding the largest value in an NSTreeController? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Displaying current time using NSCalenderDAte
  • Next by Date: incorporating mail
  • Previous by thread: Re: Finding the largest value in an NSTreeController?
  • Next by thread: Re: Finding the largest value in an NSTreeController?
  • Index(es):
    • Date
    • Thread