关于 iOS 程序调试 及腾讯 Bugly 的演练

本文介绍了iOS程序调试中的调用堆栈概念,并通过一个Demo演示了如何利用调用堆栈快速定位错误。此外,文章详细讲解了如何集成和使用腾讯Bugly框架,在真机测试时收集和分析错误信息,以便于在程序上线后更好地追踪和解决崩溃问题。
摘要由CSDN通过智能技术生成

程序调试

● 调用堆栈

我们先写一个 Demo 演示一下错误

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self testDemo];
}

- (void)testDemo {
    NSString *str = nil;
    NSArray *array = @[@"hello word!", str];
    
    NSLog(@"%@", array);
}

运行后 程序很听话的报错了!

**2016-11-09 23:02:58.839 01-Bugly[976:81766] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]'**
***** First throw call stack:**
**(**
** 0   CoreFoundation                      0x000000011150034b __exceptionPreprocess + 171**
** 1   libobjc.A.dylib                     0x0000000110f6121e objc_exception_throw + 48**
** 2   CoreFoundation                      0x00000001114103b3 -[__NSPlaceholderArray initWithObjects:count:] + 275**
** 3   CoreFoundation                      0x00000001114175c4 +[NSArray arrayWithObjects:count:] + 52**
** 4   01-Bugly                            0x000000010fd06332 -[ViewController testDemo] + 98**
** 5   01-Bugly                            0x000000010fd062c9 -[ViewController viewDidLoad] + 7
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值