为了账号安全,请及时绑定邮箱和手机立即绑定

​ xcode 7.0运行时main.m报错

 

    _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // 实例化

               _window.backgroundColor = [UIColor blueColor]; //window 的背景色

    [_window makeKeyAndVisible];

    //让window成主窗口 并可见


运行结果

2015-12-15 22:22:50.838 UIWindow[6315:671478] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294

2015-12-15 22:22:50.845 UIWindow[6315:671478] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'

*** First throw call stack:

(

0   CoreFoundation                      0x000000010a97af65 __exceptionPreprocess + 165

1   libobjc.A.dylib                     0x000000010a3f4deb objc_exception_throw + 48

2   CoreFoundation                      0x000000010a97adca +[NSException raise:format:arguments:] + 106

3   Foundation                          0x000000010a042ae2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198

4   UIKit                               0x000000010ad26275 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2875

5   UIKit                               0x000000010ad22ff0 -[UIApplication workspaceDidEndTransaction:] + 188

6   FrontBoardServices                  0x000000010d63a7ac -[FBSSerialQueue _performNext] + 192

7   FrontBoardServices                  0x000000010d63ab1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45

8   CoreFoundation                      0x000000010a8a70a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

9   CoreFoundation                      0x000000010a89cfcc __CFRunLoopDoSources0 + 556

10  CoreFoundation                      0x000000010a89c483 __CFRunLoopRun + 867

11  CoreFoundation                      0x000000010a89be98 CFRunLoopRunSpecific + 488

12  UIKit                               0x000000010ad2298d -[UIApplication _run] + 402

13  UIKit                               0x000000010ad27676 UIApplicationMain + 171

14  UIWindow                            0x0000000109ef4e8f main + 111

15  libdyld.dylib                       0x000000010d00692d start + 1

16  ???                                 0x0000000000000001 0x0 + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException



正在回答

1 回答

libdyld.dylib`start:

    0x10d65592c <+0>: nop    

    0x10d65592d <+1>: movl   %eax, %edi

    0x10d65592f <+3>: callq  0x10d655966               ; symbol stub for: exit

    0x10d655934 <+8>: hlt    


 0x10d65592d <+1>: movl   %eax, %edi  这里报错 新手求大牛调试

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
iOS基础教程之界面初体验
  • 参与学习       44186    人
  • 解答问题       59    个

看了这么久的控制台,该换换口味了,让你体会到界面的神奇所在

进入课程

​ xcode 7.0运行时main.m报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信