2016-10-10 6 views
0

나는 현재 엑스 코드에 내가 Qt를 만들어 봤어요 응용 프로그램을 실행하기 위해 노력하고있어,하지만 난 엑스 코드에서 실행하려고 할 때 나는이 예외 얻을 :엑스 코드 오류 NSException

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 

사람이 제발 도움이 될 수 있습니까?

답변

1

앱의 info.plist에서 NSPrincipalClass 키를 하위 클래스의 이름으로 변경해야합니다. 이렇게하면 응용 프로그램이로드 될 때 Cocoa가 올바른 클래스를 인스턴스화하게됩니다. 하위 클래스를 작동시키기 위해 다른 것을 할 필요는 없습니다. 또한이 링크를 살펴보면 질문에 대한 통찰력을 더할 수 있습니다. Demystifying NSApplication

+0

방금 ​​발견했습니다. 감사합니다. –

+0

문제 없습니다. 미래의 사람들이이 솔루션을 활용할 수 있도록 투표를 할 수 있다면. – CoderJimmy