I am trying to put a C-style function in the title of an Objective-C class. (My terminology may be wrong here - I'm just used to writing methods of the Objective-C class, not functions). It looks like this:
NSInteger sort(NSString *aString, NSString *bString, void *context);
NSInteger sort(NSString *aString, NSString *bString, void *context) {
return [aString compare:bString options:NSNumericSearch];
}
This directly leads to:
Expected '=', ',', ';', 'asm' or 'attribute' before '{' token
Any ideas on what I am missing? Thank.
source
share