Skip to content

Instantly share code, notes, and snippets.

@rbarbera
Created April 26, 2013 20:56
Show Gist options
  • Save rbarbera/5470383 to your computer and use it in GitHub Desktop.
Save rbarbera/5470383 to your computer and use it in GitHub Desktop.
__block NSUInteger outerIndex = -1;
[lista enumerateObjectsUsingBlock:^(NSString *word, NSUInteger idx, BOOL *stop) {
__block NSUInteger innerIndex = -1;
[datos enumerateObjectsUsingBlock:^(NSString *palabra, NSUInteger indice, BOOL *parada) {
if ([word isEqualToString:palabra]) {
NSLog(@"log1: coinciden el %d", indice); //(log1) si pongo este log deja de aparecer el log3
innerIndex = idx;
*parada = YES;
}
}];
if (innerIndex!=-1) outerIndex = innerIndex;
NSLog(@"log2: vamos por %@", word); // (log2) si pongo este log dejan de aparecer log3 y log1
}];
NSLog(@"log3: You've stopped at index %i by word [%@]",outerIndex, lista[outerIndex]); // (log3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment