add itterators and make -free actually free the Array object

This commit is contained in:
Bill Currie 2003-07-24 20:50:40 +00:00
parent 3a1c35faab
commit 673f6ba643
2 changed files with 17 additions and 0 deletions

View file

@ -19,6 +19,8 @@
- (id) removeItemAt: (integer) index;
- (id) insertItemAt: (integer) index item:(id) item;
- (integer) count;
-(void)makeObjectsPerformSelector:(SEL)selector;
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg;
@end
#endif//__ruamoko_Array_h

View file

@ -24,6 +24,7 @@
for (i = 0; i < count; i++)
[array[i] free];
obj_free (array);
[super free];
}
- (id) getItemAt: (integer) index
@ -105,4 +106,18 @@
return count;
}
-(void)makeObjectsPerformSelector:(SEL)selector
{
local integer i;
for (i = 0; i < count; i++)
[array[i] perform:selector];
}
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg
{
local integer i;
for (i = 0; i < count; i++)
[array[i] perform:selector withObject:arg];
}
@end