Skip to content

Instantly share code, notes, and snippets.

@nonopolarity
nonopolarity / loop.m
Created September 2, 2012 05:11
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);