Skip to content

Instantly share code, notes, and snippets.

@sbrocket
Created July 6, 2011 18:51
Show Gist options
  • Select an option

  • Save sbrocket/1068029 to your computer and use it in GitHub Desktop.

Select an option

Save sbrocket/1068029 to your computer and use it in GitHub Desktop.
NSError *error = nil;
if (![self myMethodThatCanFail:&error]) {
NSLog(@"%@", error);
}
////////
- (BOOL)myMethodThatCanFail:(NSError **)errorPtr {
// This method sucks so much that it always fails :(
if (errorPtr != NULL) {
*errorPtr = [NSError errorWithDomain:@"SomeDomain" code:1 userInfo:nil];
}
return NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment