0

Action Sheet Picketを使用しています。readme、ピッカーの指示に従って.hおよび.mファイルを追加しましcancelActionたが、うまく機能していますが、どういうわけかsuccessActionNSInvalidArgumentException認識されないセレクターがインスタンスに送信されました」というメッセージが表示されます。

アプリはタブバーアプリの一種で、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'

どんな助けでも素晴らしいでしょう。

4

1 に答える 1

2

ピッカーは応答するかどうかをチェックせず、直接呼び出すため、クラスに実装successAction:する必要があります。MYYViewController

于 2012-12-26T13:29:55.530 に答える