AppDelegate error after upgrading to Cocos2d 2.1
-
11-12-2019 - |
Question
In an attempt to fix issues with iOS 6 and the iphone 5 I have upgraded the game I'm developing from cocos2d 1.1 to cocos2d 2.1. After going through and changing out all the code I'm now getting this error:
'Unable to instantiate the UIApplication delegate instance. No class named AppDelegate is loaded.'
AppDelegate.h and AppDelegate.m are definitely included in my project. I do note that they define the class AppController rather than AppDelegate - but that's how it is in the cocos2d 2.1 test project that compiles and runs fine. The code I've got in AppDelegate.h and AppDelegate.m are copied directly from the empty test project, with the exception that I've added Flurry.h and the line to include Flurry analytics in my project.
Solution
Cocos2D 1.0
AppDelegate* app = (AppDelegate*)[[UIApplication sharedApplication] delegate];
//app.viewController.view
Cocos2D 2.0
AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
//app.navController.view