views:

39

answers:

2

Hi all,

i want to sort NSArray of UIImageView according their frame?

i try for NSSortDescriptor but when i write key=@"frame" unrecognized selector error occur. please tell me how to sort my array.

thanks in advance.

A: 

You can use this to sort that array http://stackoverflow.com/questions/2553894/sorting-nsarray-and-returning-nsarray

Abhishek Gupta
but compare: use for only nsstring,nsnumber,nsdata ect support it will not work for CGPoint
priyanka
+1  A: 

You can always write your own comparator function and define custom sorting behavior by using NSArray sortedArrayUsingSelector method

taskinoor