iOS-compile_debug-crash_record

本文列举了iOS开发中遇到的多个崩溃问题及其解决方案,包括线程安全、字符串编码转换、方法未识别、数据库线程安全、空指针异常等,并提供了相应的修复建议和参考资料。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 对同一个变量,在不同线程,同时读写的问题。 崩溃定位:越界。
解决方案:
变量加锁


2.
*** -[__NSCFString dataUsingEncoding:allowLossyConversion:]: didn't convert all characters
推测是某些字符不能转换,但也不应该崩溃呀。
解决方案:允许有损转换:
NSData* retData = [unicodeStr dataUsingEncoding: enc allowLossyConversion: YES]; // 使用allowLossyConversion参数


3. 
NSInvalidArgumentException
-[UIApplication applicationWillTerminate:]: unrecognized selector sent to instance 0x1c5919c0
0 CoreFoundation 0x311f364f __exceptionPreprocess 114
1 libobjc.A.dylib 0x34d0ec5d objc_exception_throw 24
2 CoreFoundation 0x311f71bf -[NSObject(NSObject) doesNotRecognizeSelector:] 102
3 CoreFoundation 0x311f6649 ___forwarding___ 508
4 CoreFoundation 0x3116d180 _CF_forwarding_prep_0 48
5 CommonTools 0x05d2cd71 setBacklightLevel 21976
6 CommonTools 0x05d3c233 memoryInfo 26634
7 CoreFoundation 0x31163571 -[NSObject(NSObject) performSelector:withObject:withObject:] 24 <
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值