Skip to content

Instantly share code, notes, and snippets.

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