iOS - 向Google Analytics发送例外

时间:2013-12-30 08:48:44

标签: ios google-analytics

我正在尝试向GA发送例外,但有些事情让我感到困惑。

根据头文件:

+ (GAIDictionaryBuilder *)createExceptionWithDescription:(NSString *)description
                                               withFatal:(NSNumber *)fatal;

但在DEV guide example

[tracker send:[GAIDictionaryBuilder
    createExceptionWithDescription:@"Connection timout %d: %@", connectionError, errorDescription  // Exception description. May be truncated to 100 chars.
                         withFatal:NO] build];  // isFatal (required). NO indicates non-fatal exception.

NSNumberBOOLfatalfatal。那么,我应该为{{1}}填写什么号码?或者只是1或0来表示是或否?因为布尔值似乎对我更有意义。

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

试试这个..

[tracker send:[GAIDictionaryBuilder
    createExceptionWithDescription:@"Connection timout %d: %@", connectionError, errorDescription  // Exception description. May be truncated to 100 chars.
                         withFatal:[NSNumber numberWithBool:NO] build];

答案 1 :(得分:0)

[tracker send:[[GAIDictionaryBuilder
createExceptionWithDescription:@"Connection timout %d: %@", connectionError, errorDescription
withFatal:NO]build]];