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 <
解决方案:
变量加锁
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 <