Skip to content

Instantly share code, notes, and snippets.

@favoretti
Created January 4, 2012 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save favoretti/1562489 to your computer and use it in GitHub Desktop.
Save favoretti/1562489 to your computer and use it in GitHub Desktop.
-(NSIndexSet *) lookupAll: (NSString *) theName
{
NSIndexSet *result = [book indexOfObjectsPassingTest:
^(id obj, NSUInteger idx, BOOL *stop)
{
if ([[obj name] caseInsensitiveCompare: theName] ==
NSOrderedSame)
return YES; // found a match, keep going
else
return NO; // keep looking
}];
// Return the result
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment