xcode 7.1立即崩溃w无输出 [英] xcode 7.1 immediate crash w no output
问题描述
前言:
我想让iPad pro以原生分辨率运行我的应用程序,所以我添加了启动屏幕文件。我设置新的控制器是一个入口点,然后经过一些调整,我删除了该文件,并回到没有启动屏幕。
崩溃:
我没有输出(lldb)
。我在控制台中键入 bt
,并获得以下
输出
$ b b
* thread#1:tid = 0xd26faa,0x000000011351ddbb libobjc.A.dylib`objc_exception_throw,queue ='com.apple.main-thread',stop reason = breakpoint 1.1
帧#0:0x000000011351ddbb libobjc.A.dylib`objc_exception_throw
帧#1:0x0000000112730159 UIKit` + UIStoryboard storyboardWithName:捆绑:] + 727
帧#2:0x0000000112015c7f UIKit`- [UIApplication的_loadMainStoryboardFileNamed :包:] + 58
帧#3:0x0000000112015fd3 UIKit`- [UIApplication的_loadMainInterfaceFile] + 260
帧#4:0x0000000112014851 UIKit`- [UIApplication的_runWithMainScene:transitionContext:完成:] + 1380
帧#5:0x0000000112011ba3 UIKit`- [UIApplication的workspaceDidEndTransaction:] + 188
帧#6:0x000000011a5b0784 FrontBoardServices`- [FBSSerialQueue _performNext] + 192
帧#7:0x000000011a5b0af2 FrontBoardServices`- [FBSSerialQueue _performNextFromRunLoopSource] + 45
帧#8:0x0000000113a85011 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
帧#9:0x0000000113a7af3c CoreFoundation`__CFRunLoopDoSources0 + 556
帧#10:0x0000000113a7a3f3 CoreFoundation`__CFRunLoopRun + 867
帧# 11:0x0000000113a79e08 CoreFoundation`CFRunLoopRunSpecific + 488
帧#12:0x00000001120114f5 UIKit`- [UIApplication的_run] + 402
帧#13:0x000000011201630d UIKit`UIApplicationMain + 171
*帧#14:0x000000010fa23b22 MyApp`main(ARGC = 1,argv的= 0x00007fff501e1818)+ 146在main.m文件:28
帧#15:0x00000001179f892d libdyld.dylib`start + 1
帧#16:0x00000001179f892d libdyld.dylib`start + 1
当然main.m是通用的,没有帮助
main.m
#import< UIKit / UIKit.h>
#importAppDelegate.h
/ *
int main(int argc,char * argv [])
{
@autoreleasepool {
return UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class])));
}
}
* /
int main(int argc,char * argv []){
// NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = -1;
@try {
@autoreleasepool {
retVal = UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class])));
}
}
@catch(NSException * exception){
// NSLog(@Uncaught exception:%@,exception.description);
// NSLog(@堆栈跟踪:%@,[exception callStackSymbols]);
}
// [pool release];
return retVal;
}
我的下一个疑难解答应该是什么?
在xcode 7.1(以及许多其他版本)中,在应用程序的常规设置包括:
- 主界面 (在部署信息下) 启动屏幕文件(在应用图标和启动图片下)
$ b b
问题
我不知道到底在什么时候,但在某个时候我混淆了这两个选项。作为故障排除策略的一部分,我开始把一切都回到它是什么时候应用程序的工作。在此过程中,我遇到此错误。错误是试图告诉我,相当含糊,我的应用程序中的东西没有响应某个(未指定)选择器。
解决方案
ul>
故事板
(File> New> File ...> ),并设置启动点。 启动屏幕
(文件>新建>文件。 ..>启动屏幕)注意 - 如果您不想/需要,可以选择停止使用启动屏幕。我使用一个,因为这是一个简单的方法,让您的应用程序以原生分辨率在iPhone 6 / s(s)+ / iPad Pro上显示。Preface:
I'm trying to get the iPad pro to run my app at native resolution so I added a Launch Screen file. I set the new controller to be an entry point then after some tweaks I deleted the file and went back to no Launch Screen.
Crash:
I get no output other than (lldb)
. I typed bt
into the console and got the following
output
* thread #1: tid = 0xd26faa, 0x000000011351ddbb libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x000000011351ddbb libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000112730159 UIKit`+[UIStoryboard storyboardWithName:bundle:] + 727
frame #2: 0x0000000112015c7f UIKit`-[UIApplication _loadMainStoryboardFileNamed:bundle:] + 58
frame #3: 0x0000000112015fd3 UIKit`-[UIApplication _loadMainInterfaceFile] + 260
frame #4: 0x0000000112014851 UIKit`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1380
frame #5: 0x0000000112011ba3 UIKit`-[UIApplication workspaceDidEndTransaction:] + 188
frame #6: 0x000000011a5b0784 FrontBoardServices`-[FBSSerialQueue _performNext] + 192
frame #7: 0x000000011a5b0af2 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 45
frame #8: 0x0000000113a85011 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #9: 0x0000000113a7af3c CoreFoundation`__CFRunLoopDoSources0 + 556
frame #10: 0x0000000113a7a3f3 CoreFoundation`__CFRunLoopRun + 867
frame #11: 0x0000000113a79e08 CoreFoundation`CFRunLoopRunSpecific + 488
frame #12: 0x00000001120114f5 UIKit`-[UIApplication _run] + 402
frame #13: 0x000000011201630d UIKit`UIApplicationMain + 171
* frame #14: 0x000000010fa23b22 MyApp`main(argc=1, argv=0x00007fff501e1818) + 146 at main.m:28
frame #15: 0x00000001179f892d libdyld.dylib`start + 1
frame #16: 0x00000001179f892d libdyld.dylib`start + 1
of course main.m is generic and of no help
main.m
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
/*
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
*/
int main(int argc, char *argv[]) {
//NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = -1;
@try {
@autoreleasepool {
retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
@catch (NSException* exception) {
// NSLog(@"Uncaught exception: %@", exception.description);
// NSLog(@"Stack trace: %@", [exception callStackSymbols]);
}
//[pool release];
return retVal;
}
What should my next troubleshooting move be?
In xcode 7.1 (and many other versions), in the general settings for an application, you'll find a number of fields including:
- Main Interface (under Deployment Info)
- Launch Screen File (under App Icons and Launch Images)
Issue
I'm not sure exactly when, but at some point I had confused these two options. As part of a troubleshooting tactic I started to put everything back how it was when the app was working. During that process I encountered this error. The error was trying to tell me, quite ambiguously, that something in my app wasn't responding to an certain (unspecified) selector. I wasn't about to sift through 100+ files so I started working my way backward, again.
Solution
- Make sure Main Interface is a
storyboard
(File > New > File... > Storyboard) with an initiation point set. - Make sure Launch Screen File is a
launch screen
(File > New > File... > Launch Screen) Note- You can opt out of using a Launch Screen if you don't want / need it. I use one because it's an easy way to get your app to display at the native resolution on an iPhone 6(s) / 6(s)+ / iPad Pro.
这篇关于xcode 7.1立即崩溃w无输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!