Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (31 sloc) 0.601 kb
fe81cc6 @tomaz Implemented basic text processing.
authored
1 //
2 // NSArray+GBArray.m
3 // appledoc
4 //
5 // Created by Tomaz Kragelj on 13.1.11.
6 // Copyright 2011 Gentle Bytes. All rights reserved.
7 //
8
9 #import "NSArray+GBArray.h"
10
11 @implementation NSArray (GBArray)
12
13 - (id)firstObject {
14 if ([self count] == 0) return nil;
15 return [self objectAtIndex:0];
16 }
17
18 - (BOOL)isEmpty {
19 return ([self count] == 0);
20 }
21
22 @end
23
24 #pragma mark -
25
26 @implementation NSMutableArray (GBMutableArray)
27
28 - (void)push:(id)object {
29 [self addObject:object];
30 }
31
32 - (id)pop {
33 id result = [self peek];
34 [self removeLastObject];
35 return result;
36 }
37
38 - (id)peek {
39 return [self lastObject];
40 }
41
42 @end
Something went wrong with that request. Please try again.