Hello,
I have a big trouble that i want to call C++ function from Objective-C but it does not easy for me.
This is the lifecycle:
CategoryScreen.cpp function => iOSBridge.mm function => Call SpeakerViewController.mm => Button press => call function categoryscreen.cpp again.
1.CategoryScreen.cpp function
void CategoryScreen::loadElementIntoViewRecord()
{
>
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
>
iOSBridge::addNativeRecordView_iOS(result.size());
#endif
>
}
- iOSBridge.mm function
void iOSBridge::addNativeRecordView_iOS(short int rows) {
>
id sth = [[UIApplication sharedApplication] delegate];
>
if ([sth isKindOfClass:[AppController class]]) {
>
SpeakHereViewController *speakViewController = [[SpeakHereViewController alloc] initWithNibName:`“SpeakHereViewController” bundle:nil withManyRows:rows];
speakViewController.view.frame = CGRectMake(585, 275, 156, 494);
AppController *controller = (AppController *) sth;
[controller.viewController.view addSubview:speakViewController.view];}
}
3.SpeakerViewController.mm
[cell.btn_record addTarget:self action:`selector(recordComplete:) forControlEvents:UIControlEventTouchUpInside];
- When recording complete, i want to call void::CategoryScreen updateUI() in CategoryScreen.cpp but how I can call it ?
Please help me, thanks in advance !