Conflict with Google Analytics

14 views
Skip to first unread message

bigonth...@gmail.com

unread,
Oct 8, 2015, 3:06:06 PM10/8/15
to Cedar Discussion
The application we are testing has the GoogleAnalytics pod install. When running Cedar spec, I was getting a BAD_ACCESS at the line below:

BOOL CDRClassHasClassMethod(Class class, SEL selector) {
    const char *className = class_getName(class);
    if (strcmp("UIAccessibilitySafeCategory__NSObject", className) &&
        strcmp("SCRCException", className)) {
        return !!class_getClassMethod(class, selector);
    }
    return NO;
}

I noticed that the model in question at the time of the BAD_ACCESS was GAITrackerModel, which belongs to Google Analytics

I created a work around for the issue as follow

BOOL CDRClassHasClassMethod(Class class, SEL selector) {
    const char *className = class_getName(class);
    if (strcmp("UIAccessibilitySafeCategory__NSObject", className) &&
        strcmp("SCRCException", className)) {
        
        if (strcmp("GAITrackerModel", className) == 0){
            return NO;
        }
        return !!class_getClassMethod(class, selector);
    }
    return NO;
}
 

This works for the time being, but I'm wondering if there's a more elegant solution. Any thoughts/suggestions?

Thanks!
-Danny 
Reply all
Reply to author
Forward
0 new messages