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