はまあ、私のようなカスタムSEL作成しています:objective-C:performSelectorの実行方法:@セレクタ?
NSArray *tableArray = [NSArray arrayWithObjects:@"aaa", @"bbb", nil];
for (NSString *table in tableArray){
SEL customSelector = NSSelectorFromString([NSString stringWithFormat:@"abcWith%@", table]);
[self performSelector:customSelector withObject:0];
}
を私はエラーを得た: がキャッチされない例外により「NSInvalidArgumentException」、理由にアプリを終了:「 - [同期aaaWithaaa]:認識されていないセレクタがに送信されましたインスタンス
実際のメソッド名で実行した場合、動作します。
[self performSelector:@selector(aaaWithaaa:) withObject:0];
どうすれば解決できますか?ありがとう!
あなたはすでに文字列からセレクタを作成しました
ありがとうございます、私の質問 –
を更新しましたあなたの権利がある!コロン! –