I'm trying to create a compare function like the example on the apple site:
The example is not objective-c. Does anyone know how I can convert the example:
NSInteger intSort(id num1, id num2, void *context)
{
int v1 = [num1 intValue];
int v2 = [num2 intValue];
if (v1 < v2)
return NSOrderedAscending;
else if (v1 > v2)
return NSOrderedDescending;
else
return NSOrderedSame;
}
to a function I can call with sortedArrayUsingFunction.
Thanks!