The compiler complains about this:
int randomSort(id obj1, id obj2, void *context) { // first line
return (arc4random()%3 - 1);
}
in first line:
_cmd undeclared
and
‘self’ undeclared (first use in this
function)
When I not use arc4random() here, i.e. just return 1, everything is fine. I have other c functions in this file which use arc4random() without problems.
Any idea?
You need to tell the signature of the arc4random() function before using it, i.e.
Or include/import an appropriate header file. If your randomSort function is really the first line, then obviously there is no line before, making it impossible you included/imported that (not regarding precompiled headers here).