[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!