开发者

report which method caused my NSException?

开发者 https://www.devze.com 2023-04-04 23:32 出处:网络
I am using Flurry Analytics which reports my app crashes, works great except I don\'t kno开发者_开发技巧w which method caused the crash.

I am using Flurry Analytics which reports my app crashes, works great except I don't kno开发者_开发技巧w which method caused the crash.

I am catching the uncaught exceptions like this:

{
    [FlurryAnalytics logError:@"Uncaught" message:[NSString stringWithFormat:@"Crash! %@", [[UIDevice currentDevice] uniqueIdentifier]] exception:exception];

}

If I could only see which method this would be absolutely perfect. Thoughts?


Use

NSlog(@"function that crashed %s",__FUNCTION__);

This is an extension to the compiler and works fine.

UPDATE

to get the complete call stack from the current thread use:

[NSThread callStackSymbols]

which gives you the call stack as NSString.

0

精彩评论

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