Some of Apple's obj-c API's still use C functions, e.g.:
-(NSArray * ) sortedArrayUsingFunction: (NSInteger (*)(id, id, void *))comparator context:(void *)context
...which is great, except I'm struggling to see how you can store fn-pointers inside ObjC classes.
e.g. to share the same "sort" function in different parts of your program. Say you have different data, in different contexts/classes, but you want the same sort in both places (for consistency).
I'm sure this is simple, but either my C is too rusty, or there's some gotcha. I tried sticking a plain variable inside the header file:
NSInteger (*)(id, id, void *) myComparator;
...and all I get is a compiler error:
Expected identifier or '(' before ')' token