Hi all,
In my objective c class, I'd like to sort an array like this:
NSArray *sorted = [unsortedArray sortUsingFunction: mySort context: NULL];
My sort function is implemented as:
NSInteger mySort(id one, id two, void *ctx) { return 1; }
When I build the program the compiler tells me:
error: void value not ignored as it ought to be
Now I think I know what the compiler is trying to tell me:
"I don't know what the heck "mySort" is so I will assume it returns 'void'. Oops, looks like you are trying to assign 'void' to a variable, nope can't do that. Try again."
Alright, Mr. compiler, what in the world to I have to tell you so you know the function prototype is NSInteger mySort(id, id, void*)? I tried putting that line in the class header file, before the "@interface", after, pretty much all over the place, but I can't get this to work.
Where/how do I have to declare the function prototype for my sort function?
Big thanks in advance, Mark.