Skip navigation.
 
mlRe: Sorting array of NSDictionaries sortedArrayUsingFunction
FROM : glenn andreas
DATE : Tue Jun 13 23:47:14 2006

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_removed>
  <http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate  | images, textures, 
fractals, art

Related mailsAuthorDate
mlSorting array of NSDictionaries sortedArrayUsingFunction David Alter Jun 13, 21:01
mlRe: Sorting array of NSDictionaries sortedArrayUsingFunction Fritz Anderson Jun 13, 23:16
mlRe: Sorting array of NSDictionaries sortedArrayUsingFunction David Alter Jun 13, 23:31
mlRe: Sorting array of NSDictionaries sortedArrayUsingFunction glenn andreas Jun 13, 23:47
mlRe: Sorting array of NSDictionaries sortedArrayUsingFunction Fritz Anderson Jun 13, 23:47