• 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: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague


  • Subject: Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
  • From: Keary Suska <email@hidden>
  • Date: Wed, 14 Dec 2011 12:05:46 -0700

On Dec 14, 2011, at 11:07 AM, Dave Reed wrote:

> Here's my sorting scenario with a few more details.
>
> Entity A (the one I'm fetching) has a to-one relation to Entity B with attribute b. Let's call the relation "tob" so my sort descriptor said withKey:@"tob.b" and it results of the fetch request did not come back in that order, but if I then sort the resulting array using the sort descriptor, it does sort it.
>
> The way I read the documentation, that should work during the fetch, but it doesn't.

Unfortunately, Core Data-Specific sort descriptor docs are fairly lacking. As I mentioned it may be that NSSortDescriptor doesn't translate key paths like NSPredicate might. It may expect them to be appropriate to a SQL query. Considering that the attribute b or entity B is unambiguous (i.e. entity A does not have an attribute with the same name), have you tried passing just "b" as the key? Another option is passing "B.b" as the key.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
      • From: David Reed <email@hidden>
References: 
 >predicates and sort descriptors for NSFetchRequest - documentation is a bit vague (From: email@hidden)
 >Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague (From: Keary Suska <email@hidden>)
 >Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague (From: Dave Reed <email@hidden>)

  • Prev by Date: Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
  • Next by Date: NSTableView - how to dynamically change the height of the elements?
  • Previous by thread: Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
  • Next by thread: Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague
  • Index(es):
    • Date
    • Thread