ClientViewController.mmクラスのメソッドを呼び出そうとしていますが、次のエラーが発生し続けます:キャッチされない例外が原因でアプリを終了しています
'NSInvalidArgumentException', reason: '+ [ClientViewController TestMethod]:
unrecognized selector sent to class
インターフェイスを実装する別のクラスがあります。
void AppleRecognitionStatusObserver::onRecognitionStatusChanged
(RecognitionStatus newStatus) {
switch(newStatus) {
case kInProgress:
[ClientViewController TestMethod];
break;
....etc
}
}
別のC++クラスからClientViewControllerメソッドを呼び出すにはどうすればよいですか?
クライアントビューコントローラー.h
//imports UIKit etc
@interface ClientViewController : UIViewController <AVAudioRecorderDelegate>{
IBOutlet UIButton *recoButton;
// some other buttons
}
@end
// and the .mm
//#imports....
@interface ClientViewController ()
@end
@implementation ClientViewController
-(void)TestMethod{
outLabel.text = @"Has been called!";
}