It is possible to get the rootviewcontroller of the project from within a class or scene in cocos2d using Xcode. This can be done using the nextResponder method of the OpenGLview of cocos2d director. It can be implemented as follows :
UIViewController *rootViewController = (UIViewController *)[[[CCDirector sharedDirector] openGLView] nextResponder];
In this, the rootViewController object will contain the original root view controller of the project.
Incoming search terms:
- cocos2d 2 0 rootviewcontroller
- cocos2d-x get rootviewcontroller
- cocos2d-x view controller
- cocos2d-x viewcontroller scene
- xcode root view controller news





