Skip to content

Instantly share code, notes, and snippets.

@nonopolarity
Created September 2, 2012 05:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nonopolarity/3594998 to your computer and use it in GitHub Desktop.
Save nonopolarity/3594998 to your computer and use it in GitHub Desktop.
Objective-C looping through array using a block
NSArray *array = @[
@"hello",
@"world",
[NSNull null],
@123,
@123.456
];
[array enumerateObjectsUsingBlock:^(id obj, NSUInteger i, BOOL *stop) {
NSLog(@"obj %d is %@", i, obj);
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment