Я пытаюсь вызвать метод в своем классе ClientViewController.mm и продолжаю получать эту ошибку: Завершение работы приложения из-за необработанного исключения
'NSInvalidArgumentException', reason: '+ [ClientViewController TestMethod]:
unrecognized selector sent to class
У меня есть еще один класс, который реализует интерфейс.
void AppleRecognitionStatusObserver::onRecognitionStatusChanged
(RecognitionStatus newStatus) {
switch(newStatus) {
case kInProgress:
[ClientViewController TestMethod];
break;
....etc
}
}
Как вызвать методы ClientViewController из другого класса C++?
client view controller.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!";
}
ClientViewController
метод класса с именемTestMethod
? - person Carl Norum   schedule 13.03.2013TestMethod
для экземпляраClientViewController
, а не для самого класса. - person Carl Norum   schedule 13.03.2013