Skip to content

Instantly share code, notes, and snippets.

@gavrix
Created September 13, 2012 13:38
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 gavrix/3714339 to your computer and use it in GitHub Desktop.
Save gavrix/3714339 to your computer and use it in GitHub Desktop.
-firstObject
@interface NSArray (addition)
-(id) firstObject;
@end
@implementation NSArray (addition)
-(id) firstObject
{
return [self count]?[self objectAtIndex:0]:nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment