iphone - how to sort an NSArray of nested NSArrays by array count? -


i have nsarray contains nested nsarrays. im looking way sort parent array according object count of nested arrays in ascending order. if [array1 count] 4, [array2 count] 2 , [array3 count] 9, : array2, array1, array3...

there few solutions, 1 of is:

nssortdescriptor *sd = [nssortdescriptor sortdescriptorwithkey:@"@count"                                                      ascending:yes]; nsarray *sds = [nsarray arraywithobject:sd]; nsarray *sortedarray = [array sortedarrayusingdescriptors:sds]; 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -