技术CTO-关注编程入门知识,提供编程入门教程

您的位置: 首页 > 移动开发 > ios > 正文

本人小白,运行后ios模拟器弹出这个界面是怎么回事啊

来源: 技术CTO 阅读:

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}


中间还有一行小字thread 1:signal SIGABRT


求解怎么办

在线等答案,求大神
你的代码写的有问题,这个要从底部中间那个框里面才能看出问题的所在!!!
看看下面的标准输出框抛了什么异常
很可能是访问了不存在的内存
这个说明你程序在运行或者启动过程中程序崩溃了,添加断点看下,具体断在了哪一行
这是出异常了
这就是崩了呗,一般崩了,就报在这一行,但是要看控制台里面输出的错误信息
第一步:打开调试窗口:在xcode软件右上方单击倒数第二个按钮,在编辑器的下方显示all output小窗口
第二步:在调试窗口中将异常信息复制出来,然后跟贴
第三步:要根据你的错误信息进行问题诊断
is crash 
2016-04-09 15:14:49.284 JoinUs[1857:136651] DiskCache: 90112 of 536870912
2016-04-09 15:14:49.285 JoinUs[1857:136651] MemoryCache: 0 of 268435456
2016-04-09 15:14:51.205 JoinUs[1857:136651] viewWillAppear
2016-04-09 15:14:51.209 JoinUs[1857:136651] -[__NSCFData dataUsingEncoding:]: unrecognized selector sent to instance 0x7fe941e0e9c0
2016-04-09 15:14:51.213 JoinUs[1857:136651] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFData dataUsingEncoding:]: unrecognized selector sent to instance 0x7fe941e0e9c0'
*** First throw call stack:
(
0   CoreFoundation                      0x0000000104aa0d85 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000104514deb objc_exception_throw + 48
2   CoreFoundation                      0x0000000104aa9d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3   CoreFoundation                      0x00000001049efcfa ___forwarding___ + 970
4   CoreFoundation                      0x00000001049ef8a8 _CF_forwarding_prep_0 + 120
5   JoinUs                              0x0000000103fb25a0 -[JSONModel initWithString:usingEncoding:error:] + 192
6   JoinUs                              0x0000000103fb2422 -[JSONModel initWithString:error:] + 130
7   JoinUs                              0x0000000103fcc049 -[NetworkManager myProfile] + 169
8   JoinUs                              0x0000000103fc92bc -[PersonalViewController loadData] + 156
9   JoinUs                              0x0000000103fc8f6c -[PersonalViewController viewWillAppear:] + 396
10  UIKit                               0x00000001059002bd -[UIViewController _setViewAppearState:isAnimating:] + 710
11  UIKit                               0x0000000105900958 -[UIViewController __viewWillAppear:] + 149
12  UIKit                               0x000000010593fc83 -[UINavigationController _startTransition:fromViewController:toViewController:] + 781
13  UIKit                               0x0000000105940c4d -[UINavigationController _startDeferredTransitionIfNeeded:] + 890
14  UIKit                               0x0000000105941d0b -[UINavigationController __viewWillLayoutSubviews] + 57
15  UIKit                               0x0000000105af0503 -[UILayoutContainerView layoutSubviews] + 248
16  UIKit                               0x000000010581a980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
17  QuartzCore                          0x0000000105616c00 -[CALayer layoutSublayers] + 146
18  QuartzCore                          0x000000010560b08e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
19  QuartzCore                          0x000000010560af0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
20  QuartzCore                          0x00000001055ff3c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
21  QuartzCore                          0x000000010562d086 _ZN2CA11Transaction6commitEv + 486
22  QuartzCore                          0x000000010562d7f8 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
23  CoreFoundation                      0x00000001049c5c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24  CoreFoundation                      0x00000001049c5ba7 __CFRunLoopDoObservers + 391
25  CoreFoundation                      0x00000001049bb7fb __CFRunLoopRun + 1147
26  CoreFoundation                      0x00000001049bb0f8 CFRunLoopRunSpecific + 488
27  GraphicsServices                    0x00000001093bead2 GSEventRunModal + 161
28  UIKit                               0x000000010575ff09 UIApplicationMain + 171
29  JoinUs                              0x0000000103fd1c2f main + 111
30  libdyld.dylib                       0x0000000107b8392d start + 1
31  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
出现这个,然后呢
// 找里面的reson, 通过看他的描述,判断你是哪里出错了
// 现在 说你  NSCFData 数据处理有问题
 reason: '-[__NSCFData dataUsingEncoding:]: unrecognized selector sent to instance 0x7fe941e0e9c0'

^_^ 如果您热爱技术、热爱编程,想与更多的朋友一起交流学习,欢迎加入本站官方QQ群:345733473 ^_^