[Original] iOS learning Xcode8 does not print error messages on the console, iosxcode8

Source: Internet
Author: User

[Original] iOS learning Xcode8 does not print error messages on the console, iosxcode8

I upgraded my Xcode to 8 a few days ago, but when running the program, it will print a lot of useless information, such:

Garbled characters printed when Xcode8 runs the program

Then various answers are sought and the following answers are found:

Edit Scheme-> Run-> Arguments, and add OS _ACTIVITY_MODE = disable to Environment Variables.

Solution to Garbled text

The above problem is solved, but a new problem is coming!The error message is not printed!

This is a little troublesome. It is very troublesome to guess if some errors are not printed!

Another Google attack, finally found a solution that has been used in practice, it is OK!

Specific implementation:

-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {NSSetUncaughtExceptionHandler (& uncaughtExceptionHandler); return YES ;}

 

Void uncaughtExceptionHandler (NSException * exception) {NSLog (@ "reason: % @", exception); // Internal error reporting}

 

The specific reason for this problem is probably because Xcode8 discards log printing, which leads to this problem!

The above is a summary of the small series. If you have any comments, you can raise them to facilitate timely correction!

Related Article

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.