• 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: Core Data, sorting on dependent values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data, sorting on dependent values


  • Subject: Re: Core Data, sorting on dependent values
  • From: Dave Fernandes <email@hidden>
  • Date: Thu, 26 Jul 2007 08:29:48 -0400

You can sort on transient properties. So make "fullName" a transient property of Person.

Dave

On Jul 26, 2007, at 6:41 AM, Mickaël Remars wrote:

Hello,

I face an issue with Core Data and sorting.

Model side, I have a 'Person' entity. 'Person' has 'firstName' and 'lastName' attributes coded within Core Data model. Then, I have a *derived value* 'fullName'.
Interface side, I have an NSArrayController based on 'Person' entity. I also have an NSTableView which one column is bind to derived value 'fullName'.


Now what I want to achieve is to sort table view by column 'fullName' *before* displaying the table. In other words, I don't want the end-user to sort manually, at least on application startup. So, when I *programatically* apply a sort descriptor based on 'fullName' key, Core Data complains that 'fullName' is not part of entity model. (I agree off course agree with that).

Does it mean that it is not possible to sort on a derived value when using Core Data ?
If so, how can I implement that kind of sorting ?



Thank in advance _______________________________________________

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:
40utoronto.ca


This email sent to email@hidden

_______________________________________________

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


References: 
 >Core Data, sorting on dependent values (From: Mickaël Remars <email@hidden>)

  • Prev by Date: [OT] Re: Is pointer syntax logical?
  • Next by Date: NSFileManager & hidden folders
  • Previous by thread: Core Data, sorting on dependent values
  • Next by thread: NSFileManager & hidden folders
  • Index(es):
    • Date
    • Thread