0

Possible Duplicate:
How to do a natural sort on an NSArray?

Ok I'm blanking out. I have an array of strings that looks like this:

item_0
item_1
item_14
item_26
item_3

but what I really want is:

item_0
item_1
item_3
item_14
item_26

I tried:

[myStringArray sortedArrayUsingSelector:@selector(compare:)];

but that didn't work. Any tips?

Community
  • 1
  • 1
Jeff
  • 2,778
  • 3
  • 28
  • 31
  • I just saw that. Is that really the only way to do it? – Jeff Nov 03 '10 at 03:37
  • I get a crash when I try the solution on that other post: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key (null).' – Jeff Nov 03 '10 at 03:43

0 Answers0