Last active
October 11, 2015 17:38
-
-
Save pixelknitter/3895598 to your computer and use it in GitHub Desktop.
Code Snippets for Crittercism iOS Docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare the Crittercism Delegate | |
@interface MyAwesomeViewController : UIViewController <CrittercismDelegate> | |
// Implement the protocol | |
#pragma mark CrittercismDelegate | |
-(void)crittercismDidCrashOnLastLoad { | |
NSLog(@"App crashed the last time it was loaded"); | |
} | |
// Add your delegate to the Crittercism shared object | |
[[Crittercism sharedInstance] setDelegate: <view controller where you implemented the protocol>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@try { | |
[NSException raise:NSInvalidArgumentException | |
format:@"Foo must not be nil"]; | |
} @catch (NSException *exception) { | |
// Pass it on to us! | |
[Crittercism logHandledException:exception]; | |
} | |
// Or send us something fully custom | |
NSException *exception = [NSException exceptionWithName:@"My Custom Exception" reason:@"I have a great reason" userInfo:nil]; | |
[Crittercism logHandledException:exception]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Crittercism setValue:(NSString *)value forKey:(NSString *)key]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Crittercism setAge:(int)age]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Crittercism setEmail:(NSString *)email]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Crittercism setGender:(NSString *)gender]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Opt the user out | |
[Crittercism setOptOutStatus: YES]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Crittercism setUsername:(NSString *)username]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment