• 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: Sorting array of NSDictionaries sortedArrayUsingFunction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting array of NSDictionaries sortedArrayUsingFunction


  • Subject: Re: Sorting array of NSDictionaries sortedArrayUsingFunction
  • From: glenn andreas <email@hidden>
  • Date: Tue, 13 Jun 2006 16:47:14 -0500


On Jun 13, 2006, at 4:31 PM, David Alter wrote:

Sorry about that. Here is the details about the selector

2006-06-13 14:24:57.326 TestApp[2195] *** -[NSCFDictionary sortedArrayUsingFunction:context:]: selector not recognized [self = 0x52f5b0]
2006-06-13 14:24:57.327 TestApp[2195] An uncaught exception was raised
2006-06-13 14:24:57.327 TestApp[2195] *** -[NSCFDictionary sortedArrayUsingFunction:context:]: selector not recognized [self = 0x52f5b0]
2006-06-13 14:24:57.327 TestApp[2195] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSCFDictionary sortedArrayUsingFunction:context:]: selector not recognized [self = 0x52f5b0]



I'm guessing that it is looking for the selector in the NSDictionary. But the function that I'm using for the compare is not part of the NSDictionary class. This can be seen in the example I have in my original message.


thanks for the help
-dave

No, it means that this line:

NSArray * sortedItems = [unsortedItems sortedArrayUsingFunction:orderByName context:nil];


is the problem - unsortedItems is a dictionary - not an array, and you can't sort a dictionary.

Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Sorting array of NSDictionaries sortedArrayUsingFunction (From: David Alter <email@hidden>)
 >Re: Sorting array of NSDictionaries sortedArrayUsingFunction (From: Fritz Anderson <email@hidden>)
 >Re: Sorting array of NSDictionaries sortedArrayUsingFunction (From: David Alter <email@hidden>)

  • Prev by Date: Re: dynamic GUI, how to?
  • Next by Date: Re: Sorting array of NSDictionaries sortedArrayUsingFunction
  • Previous by thread: Re: Sorting array of NSDictionaries sortedArrayUsingFunction
  • Next by thread: Re: Sorting array of NSDictionaries sortedArrayUsingFunction
  • Index(es):
    • Date
    • Thread