I'm getting error:
nested functions are disabled, use -fnested-functions to re-enable.
Could be a syntax. I just can't wrap my head around it.
- (NSArray *)sortedVariants {
NSInteger alphabeticSort(id object1, id object2, void *reverse) {
if ((NSInteger *)reverse == NO) {
return [[object1 name] localizedCaseInsensitiveCompare:[object2 name]];
}
return [[object2 name] localizedCaseInsensitiveCompare:[object1 name]];
};
return [variants sortedArrayUsingFunction:alphabeticSort context:NULL];
}
@end