mirror of
https://github.com/textmate/textmate.git
synced 2026-04-06 03:01:29 -04:00
14 lines
312 B
Plaintext
14 lines
312 B
Plaintext
#import "NSArray Additions.h"
|
|
|
|
@implementation NSArray (Other)
|
|
- (id)firstObject
|
|
{
|
|
return [self count] ? [self objectAtIndex:0] : nil;
|
|
}
|
|
|
|
- (id)safeObjectAtIndex:(NSUInteger)anIndex
|
|
{
|
|
return (anIndex < [self count] && [self objectAtIndex:anIndex] != [NSNull null]) ? [self objectAtIndex:anIndex] : nil;
|
|
}
|
|
@end
|