Xcode错误NSException [英] Xcode error NSException

查看:42
本文介绍了Xcode错误NSException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用Xt制作的应用程序在Xcode上运行,但是当我尝试在Xcode上运行它时,出现此异常:

I'm currently trying to run on Xcode an app I ve made with Qt, but when I try to run it on Xcode i get this Exception :

    dyld: warning, Ignoring DYLD_IMAGE_SUFFIX because DYLD_ROOT_PATH is used.
2016-10-10 15:37:04.777 CMP[2206:654538] *** Assertion failure in void _UIApplicationMainPreparations(int, char **, NSString *__strong, NSString *__strong)(), /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UIApplication.m:3702
2016-10-10 15:37:04.783 CMP[2206:654538] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to instantiate the UIApplication subclass instance. No class named NSApplication is loaded.'
*** First throw call stack:
(
    0   CoreFoundation                      0x06a27494 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x07c4fe02 objc_exception_throw + 50
    2   CoreFoundation                      0x06a2732a +[NSException raise:format:arguments:] + 138
    3   Foundation                          0x05eba390 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 102
    4   UIKit                               0x04703177 _UIApplicationMainPreparations + 645
    5   UIKit                               0x04702e73 UIApplicationMain + 90
    6   CMP                                 0x0004f6f6 qt_main_wrapper + 678
    7   libdyld.dylib                       0x0b53fa25 start + 1
    8   ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

任何人都可以帮忙吗?

推荐答案

在应用程序的info.plist中,确保将NSPrincipalClass键更改为子类的名称.这将使Cocoa在应用程序加载时实例化正确的类-您无需执行其他任何操作即可使子类正常工作.另外,请查看此链接,它可能还会为您的问题添加一些见解.使NSApplication神秘化

In your app's info.plist, make sure you change the NSPrincipalClass key to the name of your subclass. This'll make Cocoa instantiate the correct class when the applications loads - you shouldn't have to do anything other than that to get your subclass working. Also, take a look at this link it may also add some insights to your question. Demystifying NSApplication

这篇关于Xcode错误NSException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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