Re: Sorting array of NSDictionaries sortedArrayUsingFunction
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