iOS Manual exception handling

Source: Internet
Author: User

After the project is online, if the online app crashes and the leader lets you deal with the problem, what do you do with it? The previous article mentions how to get crash files and parse crash files, and you can also integrate third-party crach frameworks such as friends, BUGHD, and Flurry in your project. The principle is to extract or encapsulate the crash log generated by the system, and then upload the encapsulated crash file to the corresponding service side for parsing and processing. The following is an in-app crash collection of your own implementation

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {        Custom exception Handling    Nssetuncaughtexceptionhandler (&uncaughtexceptionhandler);        return YES;} void Uncaughtexceptionhandler (NSException *exception) {    Nsarray *symbols = [Exception callstacksymbols];// Current Call stack information    nsstring *reason = [Exception reason];//exception reason    nsstring *name = [exception name];//exception name    //Send Method 1. Store Local Next start send 2. Mail send (not line)        NSLog (@ ">>1%@", symbols);        NSLog (@ "-------------------");    NSLog (@ ">>2%@", reason);    NSLog (@ "-------------------");    NSLog (@ ">>3%@", name);}

  

iOS Manual exception handling

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.