我目前正尝试在Xcode上运行我用Qt开发的应用程序,但是当我尝试在Xcode上运行它时,我得到了这个异常:
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有人能帮忙吗?
发布于 2016-10-10 20:55:05
在应用程序的info.plist中,确保将NSPrincipalClass键更改为子类的名称。这将使Cocoa在应用程序加载时实例化正确的类--您不需要做任何其他事情就可以让您的子类正常工作。另外,看看这个链接,它也会给你的问题增添一些见解。揭开NSApplication神秘面纱
发布于 2021-01-08 21:52:15
如果您的应用程序启动是以编程方式实例化的&您遇到了这个问题,请查看您的Info.plist中是否有一个Info.plist键。如果有,就移除它,看看会发生什么。
https://stackoverflow.com/questions/39966420
复制相似问题