Skip to content

Instantly share code, notes, and snippets.

@hammerdr
Created October 19, 2009 04:18
Show Gist options
  • Save hammerdr/213072 to your computer and use it in GitHub Desktop.
Save hammerdr/213072 to your computer and use it in GitHub Desktop.
@implementation CPArray (Find)
- (CPObject)findBy:(Function)isTheObject
{
for(int i = 0; i < [self count]; i++)
{
if(isTheObject([self objectAtIndex:i]))
{
return [self objectAtIndex:i];
}
}
return nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment