无法实例化UIApplication子类实例 [英] Unable to instantiate the UIApplication subclass instance

查看:245
本文介绍了无法实例化UIApplication子类实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建SpriteBuilder项目并收到以下错误:

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

" * int UIApplicationMain(int,char **,NSString *,NSString *)(),/SourceCache/UIKit_Sim/UIKit-2903.23/UIApplication.m:2380中的断言失败 无法实例化UIApplication子类实例.没有加载名为NSApplication的类."

" * 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."

对于main.m代码:

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;
   }
}

是什么原因?

推荐答案

XCode引用了错误的info.plist文件.在构建设置"中,info.plist路径应为"Source/Resources/Info.plist",而不是"$(SRCROOT)/Source/libs/cocos2d-iphone/external/Chipmunk/xcode/main-Info.plist".更改路径即可解决此问题.

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.

这篇关于无法实例化UIApplication子类实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆