46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
{
[array addItem: &obj
atIndex: index];
[obj retain];
return self;
}
- removeObject: (OFObject*)obj
{
OFObject **objs = [array cArray];
size_t i, count = [array count];
for (i = 0; i < count; i++) {
if ([objs[i] isEqual: obj]) {
[objs[i] release];
[array removeItemAtIndex: i];
return self;
}
}
return self;
}
- removeObjectIdenticalTo: (OFObject*)obj
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
<
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
{
[array addItem: &obj
atIndex: index];
[obj retain];
return self;
}
- replaceObject: (OFObject*)old
withObject: (OFObject*)new
{
OFObject **objs = [array cArray];
size_t i, count = [array count];
for (i = 0; i < count; i++) {
if ([objs[i] isEqual: old]) {
[new retain];
[objs[i] release];
objs[i] = new;
}
}
return self;
}
- replaceObjectAtIndex: (size_t)index
withObject: (OFObject*)obj
{
OFObject **objs = [array cArray];
if (index >= [array count])
@throw [OFOutOfRangeException newWithClass: isa];
[obj retain];
[objs[index] release];
objs[index] = obj;
return self;
}
- replaceObjectIdenticalTo: (OFObject*)old
withObject: (OFObject*)new
{
OFObject **objs = [array cArray];
size_t i, count = [array count];
for (i = 0; i < count; i++) {
if (objs[i] == old) {
[new retain];
[objs[i] release];
objs[i] = new;
}
}
return self;
}
- removeObject: (OFObject*)obj
{
OFObject **objs = [array cArray];
size_t i, count = [array count];
for (i = 0; i < count; i++) {
if ([objs[i] isEqual: obj]) {
[objs[i] release];
[array removeItemAtIndex: i];
}
}
return self;
}
- removeObjectIdenticalTo: (OFObject*)obj
|