28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
@implementation OFMutableArray_adjacent
+ (void)initialize
{
if (self == [OFMutableArray_adjacent class])
[self inheritMethodsFromClass: [OFArray_adjacent class]];
}
- (void)addObject: (id)object
{
if (object == nil)
@throw [OFInvalidArgumentException
exceptionWithClass: [self class]];
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
@implementation OFMutableArray_adjacent
+ (void)initialize
{
if (self == [OFMutableArray_adjacent class])
[self inheritMethodsFromClass: [OFArray_adjacent class]];
}
- initWithCapacity: (size_t)capacity
{
self = [super init];
@try {
_array = [[OFDataArray alloc] initWithItemSize: sizeof(id)
capacity: capacity];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)addObject: (id)object
{
if (object == nil)
@throw [OFInvalidArgumentException
exceptionWithClass: [self class]];
|