Re: NSFetchedResultsController with custom NSSortDescriptor
Re: NSFetchedResultsController with custom NSSortDescriptor
- Subject: Re: NSFetchedResultsController with custom NSSortDescriptor
- From: Sebastian Celis <email@hidden>
- Date: Wed, 19 Aug 2009 12:11:36 -0500
Well, I sort dynamically on different properties so an explicit
sortIndex wouldn't be ideal. But the lack of normalization just might
work. I could create a boolean field which basically acts as
'hasProperty'. I can then hook into -willSave of the NSManagedObject
to set that to YES or NO appropriately. This would give me an easy
sort that the database should be able to handle just fine.
Thanks,
Sebastian
On Wed, Aug 19, 2009 at 11:06 AM, Kyle Sluder<email@hidden> wrote:
> You're going to need to do an in-memory sort of these objects. Your
> suspicions about Core Data sorting are correct: when using the SQLite
> store, it sends the sorting off to the database backend, where it's
> far more efficient to do.
>
> Have you thought instead of sorting on a dependent property of your
> objects? Maybe create an integer property sortIndex that is updated
> when other properties are updated. This is where you need to shut up
> the part of your brain that complains about normalization. :)
>
> --Kyle Sluder
>
_______________________________________________
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