Action Sheet Picketを使用しています。readme、ピッカーの指示に従って.hおよび.mファイルを追加しましcancelActionたが、うまく機能していますが、どういうわけかsuccessAction「NSInvalidArgumentException認識されないセレクターがインスタンスに送信されました」というメッセージが表示されます。
アプリはタブバーアプリの一種で、Navigation Controller. TabBarControlleras root があり、ViewControllerその下にある がTabBarControllerあり、ViewController の 1 つが Navigation Controller です。しかし、Navigation Controller でこのエラーが発生しません。これによりエラーが発生するかどうかはわかりません。
ここで私がどのように使用したか:
- (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'
どんな助けでも素晴らしいでしょう。