Sorting a multidimensional array in objective-c

Posted by Zen_silence on Stack Overflow See other posts from Stack Overflow or by Zen_silence
Published on 2010-03-17T07:50:00Z Indexed on 2010/03/17 8:11 UTC
Read the original article Hit count: 830

Hello,

I'm trying to sort a multidimensional array in objective-c i know that i can sort a single dimensional array using the line of code below:

NSArray *sortedArray = [someArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];

I can't seem to figure out how to sort a 2D array like the one below:

 ( ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY"),
    ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY"),
    ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY") );

If someone could provide me code that would sort the array by SOME_CATEGORY it would be of great help to me.

Thanks,

Zen_Silence

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone