Unable to instantiate the UIApplication subclass instance

久未见 提交于 2019-12-14 03:17:34

问题


i'm building a SpriteBuilder project and getting the error of:

" * Assertion failure in int UIApplicationMain(int, char **, NSString *, NSString *)(), /SourceCache/UIKit_Sim/UIKit-2903.23/UIApplication.m:2380 Unable to instantiate the UIApplication subclass instance. No class named NSApplication is loaded."

For the main.m code of:

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

@autoreleasepool {
    int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
    return retVal;
   }
}

What's the cause?


回答1:


XCode is referring to the wrong info.plist file. In Build Settings, the info.plist path should be "Source/Resources/Info.plist" instead of "$(SRCROOT)/Source/libs/cocos2d-iphone/external/Chipmunk/xcode/main-Info.plist". Changing the path fixed it.



来源:https://stackoverflow.com/questions/23814648/unable-to-instantiate-the-uiapplication-subclass-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!