add finding elements

This commit is contained in:
Bill Currie 2006-12-16 13:59:29 +00:00 committed by Jeff Teunissen
parent 0bd92e439a
commit 68e7b3199d
2 changed files with 10 additions and 0 deletions

View file

@ -19,6 +19,7 @@
- (id) removeItemAt: (integer) index; - (id) removeItemAt: (integer) index;
- (id) insertItemAt: (integer) index item:(id) item; - (id) insertItemAt: (integer) index item:(id) item;
- (integer) count; - (integer) count;
- (integer) findItem: (id) item;
-(void)makeObjectsPerformSelector:(SEL)selector; -(void)makeObjectsPerformSelector:(SEL)selector;
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg; -(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg;
@end @end

View file

@ -117,6 +117,15 @@
return count; return count;
} }
- (integer) findItem: (id) item
{
local integer i;
for (i = 0; i < count; i++)
if (array[i] == item)
return i;
return -1;
}
-(void)makeObjectsPerformSelector:(SEL)selector -(void)makeObjectsPerformSelector:(SEL)selector
{ {
local integer i; local integer i;