AppController替代Cocos2d 3.0

时间:2014-02-18 07:07:36

标签: cocos2d-iphone

这是我的Cocos2d 2.0调用。在Cocos2d 3.0中有什么替代方案

    AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];

    [[app navController] presentModalViewController:achivementViewController animated:YES];

2 个答案:

答案 0 :(得分:1)

在Cocos2d 3.0中,使用CCAppDelegate而不是AppController:

CCAppDelegate *app = (CCAppDelegate*) [[UIApplication sharedApplication] delegate];

[[app navController] presentModalViewController:achivementViewController animated:YES];

答案 1 :(得分:0)

AppController再次重命名为AppDelegate:

#import "AppDelegate.h"

AppDelegate * app = (((AppDelegate*) [UIApplication sharedApplication].delegate));

[[app navController] presentModalViewController:achivementViewController animated:YES];