我正在尝试根据价格字段NSMutableArray
对NSMutableDictionary
s 进行排序。
NSString* priceComparator(NSMutableDictionary *obj1, NSMutableDictionary *obj2, void *context){
return @"just for test for the moment";
}
//In other function
arrayProduct = (NSMutableArray*)[arrayProduct sortedArrayUsingFunction:priceComparator context:nil];//arrayProduct is NSMutableArray containing NSDictionarys
在上面的声明中,我收到了以下我想要修复的警告:
Incompatible pointer types sending 'NSString*(NSMutableDictionary *__strong,NSMutableDictionary *__strong,void*)' to parameter of type 'NSInteger (*)(__strong id, __strong id, void*)'