FROM : I. Savant
DATE : Tue Jan 22 20:09:05 2008
On Jan 22, 2008 2:06 PM, I. Savant <<email_removed>> wrote:
> > > How do I set up the bindings correct
> > > so my controllers fetch the data pre-sorted?
> >
> > Subclass your controller and override -arrangeObjects:.
>
> Um ... or, you could use the controller's -setSortDescriptors:
> method or its sortDescriptors binding since they're there for just
> that purpose.
Addendum: Of course if you're using Core Data, you need to be aware
that there's no pre-determined order in which you'll receive members
of a fetch (which is the case with your controller). You'd need to add
a sortable attribute to your entity like, "sortOrder" and assign each
instance a sane value. You'd use that key when setting your
controller's sort descriptors.
--
I.S.
DATE : Tue Jan 22 20:09:05 2008
On Jan 22, 2008 2:06 PM, I. Savant <<email_removed>> wrote:
> > > How do I set up the bindings correct
> > > so my controllers fetch the data pre-sorted?
> >
> > Subclass your controller and override -arrangeObjects:.
>
> Um ... or, you could use the controller's -setSortDescriptors:
> method or its sortDescriptors binding since they're there for just
> that purpose.
Addendum: Of course if you're using Core Data, you need to be aware
that there's no pre-determined order in which you'll receive members
of a fetch (which is the case with your controller). You'd need to add
a sortable attribute to your entity like, "sortOrder" and assign each
instance a sane value. You'd use that key when setting your
controller's sort descriptors.
--
I.S.
| Related mails | Author | Date |
|---|---|---|
| Chris Schmitt | Jan 22, 18:17 | |
| Kyle Sluder | Jan 22, 19:57 | |
| I. Savant | Jan 22, 20:06 | |
| I. Savant | Jan 22, 20:09 | |
| Chris Schmitt | Jan 22, 20:52 | |
| I. Savant | Jan 22, 20:57 |






Cocoa mail archive

