Skip to content

Instantly share code, notes, and snippets.

@Igor-Palaguta
Last active August 29, 2015 14:15
Show Gist options
  • Save Igor-Palaguta/d1cebdcd1975b5abd525 to your computer and use it in GitHub Desktop.
Save Igor-Palaguta/d1cebdcd1975b5abd525 to your computer and use it in GitHub Desktop.
-(BOOL)testItem:( id )item_
withError:( NSError** )error_
{
if ([item_ isEqual: @(3)])
{
*error_ = [[NSError alloc] initWithDomain: @"MyErrorDomain" code: 1 userInfo: nil];
return NO;
}
return YES;
}
-(BOOL)processArray:(NSArray*)array
withError:(NSError**)error
{
[array enumerateObjectsUsingBlock:
^(id obj, NSUInteger idx, BOOL *stop)
{
[ self testItem: obj withError: error];
}];
return NO;
}
-(void)crashMe
{
NSError* error = nil;
[self processArray: @[@1, @2, @3, @4]
withError: &error];
}
[self crashMe];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment