Xcode 使用带参数的选择器进行排序
我想将sortedArrayUsingSelector方法与我制作的需要参数的自定义比较选择器一起使用 这是我的自定义comparator declarator.h文件:Xcode 使用带参数的选择器进行排序,xcode,sorting,parameters,selector,Xcode,Sorting,Parameters,Selector,我想将sortedArrayUsingSelector方法与我制作的需要参数的自定义比较选择器一起使用 这是我的自定义comparator declarator.h文件: - (NSComparisonResult)compareWith:(Object *)otherObject AndIntParameter:(int)param; 问题是SortedArray使用选择器似乎不允许某种WithObject方法传递参数。我在找这样的东西: NSArray *sortedArrayList =
- (NSComparisonResult)compareWith:(Object *)otherObject AndIntParameter:(int)param;
问题是SortedArray使用选择器似乎不允许某种WithObject方法传递参数。我在找这样的东西:
NSArray *sortedArrayList = [anotherList sortedArrayUsingSelector:@selector(compareWith:AndIntParameter:) withObject:i];
我可以用一种肮脏的方式编码来避免这种情况,但我真的不想。。。
如果你能帮忙,非常感谢