Skip to content

Instantly share code, notes, and snippets.

@sshrpe
Created September 9, 2011 11:23
Show Gist options
  • Save sshrpe/1205980 to your computer and use it in GitHub Desktop.
Save sshrpe/1205980 to your computer and use it in GitHub Desktop.
@CaptainRedmuff's Extensions to NSArray
// Created by Stuart Sharpe on 09/09/2011.
#import "NSArray+CaptainRedmuffExtensions.h"
@implementation NSArray (CaptainRedmuffExtensions)
- (id)firstObject;
{
if (![self count]) {
return nil;
}
return [self objectAtIndex:0];
}
@end
// Created by Stuart Sharpe on 09/09/2011.
#import <Foundation/Foundation.h>
@interface NSArray (CaptainRedmuffExtensions)
- (id)firstObject;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment