Unity of IOS crash Share (NSInvalidArgumentException & SIGABRT)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/Czhenya/article/details/99116344

NSInvalidArgumentException

*** -[__NSCFString stringByAppendingString:]: nil argument

Object inserted runtime is nil
or not a call-implemented method
performSegue but not connected inside the storyboard

Solution:
(1) analyze business avoid runtime object nil case of
(2) using _obj:.? @ "" Set to the default value when the object is nil, prevent initiation Crash
(3) method to check whether the calls. achieve

Non-invasive recommended third-party libraries to avoid this problem, when necessary, can also bind bugly reported custom exception https://github.com/jasenhuang/NSObjectSafe

Solution 2:
discover the app has been on the line have this crash information, until recently, to pay attention to this issue is found in the handwriting of the time will crash, the reason is because I rewrote the following three methods in the category UIScrollview in:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[[self nextResponder] touchesBegan:touches withEvent:event];
[super touchesBegan:touches withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[[self nextResponder] touchesMoved:touches withEvent:event];
[super touchesMoved:touches withEvent:event];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[[self nextResponder] touchesEnded:touches withEvent:event];
[super touchesEnded:touches withEvent:event];
}



SIGABRT

Solution
ABORT Program
SIG is a common prefix signal names. ABRT is an abbreviation for abort program.

When the operating system detects an unsafe situation, it can have more control of this situation and, if necessary, to clean it requires process work. When commissioning the underlying cause of this error signal, and there is no coup. The C function call when the abort UIKit frame or the like cocos2d usually not meet or some bad situation in a specific preconditions (the signal transmitted by it).

If iOS system:
Occurs when UIApplication WillTerminate, occurs when the initiative to withdraw the application, so no real impact on the user.
occurred while accessing the album iOS10, currently only occurs in iOS10 + system, we need to modify the project plist file, add access prompt information.
Supplementary: iOS 10 has updated privacy policy and implemented new privacy rules You have to update your Info.plist app with this following fields by authorisation asked..

Guess you like

Origin blog.csdn.net/Czhenya/article/details/99116344