开发者

How can I leave a message in crashlog when I catch an exception?

开发者 https://www.devze.com 2023-02-05 21:32 出处:网络
I want to leave a message in crashlog when I catch an exception. Do开发者_JAVA技巧es NSLog() work?write down in catch block.

I want to leave a message in crashlog when I catch an exception. Do开发者_JAVA技巧es NSLog() work?


write down in catch block. NSLog(@"%@", [e reason]); where e is the object of NSError class.

Edited:- @try { //Your Code } @catch (NSException * e) { NSLog(@"%@", [e reason]); } The above code find out any exception arising between your code. I hope will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消