ObjC methods are case sensitive and start generally with a lowercase letter.
Actually there is no need to create a new array, the method will return a new array object
Did you fix the compare: method’s spelling as it was suggested by Stefan? Like he said, ObjC is case-sensitive, so Compare: won’t work, compare: will. Same rule applies for ObjC methods called from ASOC.
there are a lot of mistakes.
First of all, not a mistake but a naming convention violation, use always variable names beginning with a lowercase letter.
¢ In the return line a bracket is missing at the end (must be 3 brackets).
¢ the correct initializer syntax is
Unfortunately your custom method will never work in this case, because sortUsingDescriptors: expects key/value compliant objects in the array, and the method sorts the receiver itself, there is no return value.
For example, assuming the array contains NSDictionary objects with a name and age key, you can sort the array by name or by age using an appropriate NSSortDescriptor.
To sort an array of NSNumber objects numerically, either write your own comparison method for @selector(myMethod:) which must result a NSComparisonResult value,
or - since 10.6 - MSMutableArray has a new sortWithOptions:usingComparator: method which sorts the array by a given NSComparator block