Skip to content

Instantly share code, notes, and snippets.

@alanzeino
Created March 19, 2013 01:17
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 alanzeino/5192754 to your computer and use it in GitHub Desktop.
Save alanzeino/5192754 to your computer and use it in GitHub Desktop.
firstObject category for NSArray
@implementation NSArray (YOLO)
- (id)firstObject
{
if (self.count)
return [self objectAtIndex:0];
return nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment