Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 使用带参数的选择器进行排序_Xcode_Sorting_Parameters_Selector - Fatal编程技术网

Xcode 使用带参数的选择器进行排序

Xcode 使用带参数的选择器进行排序,xcode,sorting,parameters,selector,Xcode,Sorting,Parameters,Selector,我想将sortedArrayUsingSelector方法与我制作的需要参数的自定义比较选择器一起使用 这是我的自定义comparator declarator.h文件: - (NSComparisonResult)compareWith:(Object *)otherObject AndIntParameter:(int)param; 问题是SortedArray使用选择器似乎不允许某种WithObject方法传递参数。我在找这样的东西: NSArray *sortedArrayList =

我想将sortedArrayUsingSelector方法与我制作的需要参数的自定义比较选择器一起使用

这是我的自定义comparator declarator.h文件:

- (NSComparisonResult)compareWith:(Object *)otherObject AndIntParameter:(int)param;
问题是SortedArray使用选择器似乎不允许某种WithObject方法传递参数。我在找这样的东西:

NSArray *sortedArrayList = [anotherList sortedArrayUsingSelector:@selector(compareWith:AndIntParameter:) withObject:i];
我可以用一种肮脏的方式编码来避免这种情况,但我真的不想。。。 如果你能帮忙,非常感谢