ActionSheet抛出发送到实例的无法识别的选择器

时间:2012-12-26 13:27:47

标签: ios uiactionsheet

我正在使用Action Sheet Picket。我按照自述文件,选择器甚至cancelAction中的说明添加了.h和.m文件运行良好但不知何故successAction抛出NSInvalidArgumentException此消息:“无法识别的选择器发送到实例”。< / p>

应用程序是一种带有Navigation Controller的标签栏应用程序。有一个TabBarController作为根,ViewController位于TabBarController下,其中一个ViewControllers是导航控制器。但我没有在导航控制器中收到此错误。我不确定这是否会导致任何错误。

我在这里用过:

- (IBAction)filterResult:(id)sender {
    [ActionSheetStringPicker showPickerWithTitle:@"Pick Filter" rows:self.filterList initialSelection: self.selectedIndexes target:self successAction:@selector(animalWasSelected:element:) cancelAction:nil origin: self];
}


- (void)animalWasSelected:(NSNumber *)selectedIndex element:(id)element {
    self.selectedIndexes = [selectedIndex intValue];
    NSLog(@"Selected");
}

是的,这就是全部。我已经包含了ActionSheetPicker.h文件,正如我所说的选择器工作正常。

最后这是错误:

[MYYViewController successAction:]: unrecognized selector sent to instance 0x9032400
2012-12-24 12:14:45.488 Example[54268:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MYYViewController successAction:]: unrecognized selector sent to instance 0x9032400'

任何帮助都会很棒。

1 个答案:

答案 0 :(得分:2)

看起来很直接,您需要在successAction:课程中实施MYYViewController,因为选择器不会检查它是否会响应并直接调用它。

相关问题