Cocoa - array not sorting?
- by Mike
I have this set
NSMutableSet *mySet = [NSMutableSet setWithObjects: @"2", @"8", @"7", @"0", @"3", nil];
I copy the set to an array and sort it using
NSArray *sortedArray = [[mySet allObjects] sortedArrayUsingSelector:@selector(compare:)];
The resulting array is in exactly the same order as the set and is not being sorted. Why?
thanks for any help.
EDIT: CORRECING A TYPO.