Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (idx == [myArray indexOfObject:[myArray lastObject]]) {
- *stop = YES;
- }
- for( id obj in arr ){
- if( [obj isContagious] ){
- break; // Stop enumerating
- }
- if( ![obj isKindOfClass:[Perefrigia class]] ){
- continue; // Skip this object
- }
- [obj immanetizeTheEschaton];
- }
- [arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- if( [obj isContagious] ){
- *stop = YES; // Stop enumerating
- return;
- }
- if( ![obj isKindOfClass:[Perefrigia class]] ){
- return; // Skip this object
- }
- [obj immanentizeTheEschaton];
- }];
- - (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block {
- // N.B: This is probably not how this method is actually implemented!
- // It is just to demonstrate how the out parameter operates!
- NSUInteger idx = 0;
- for( id obj in self ){
- BOOL stop = NO;
- block(obj, idx++, &stop);
- if( stop ){
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement