FROM : I. Savant
DATE : Sat May 31 21:05:58 2008
> 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.
DATE : Sat May 31 21:05:58 2008
> 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.
| Related mails | Author | Date |
|---|---|---|
| Rick Mann | May 31, 11:35 | |
| Jonathan Dann | May 31, 11:57 | |
| Rick Mann | May 31, 20:47 | |
| I. Savant | May 31, 21:05 | |
| Rick Mann | May 31, 22:12 | |
| Jonathan Dann | May 31, 22:26 | |
| I. Savant | May 31, 22:36 | |
| Jonathan Dann | May 31, 23:28 |






Cocoa mail archive

