Skip to content

Instantly share code, notes, and snippets.

@gavrix
Created September 13, 2012 13:38
Embed
What would you like to do?
-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