Support for collection subscripting (NSArray and NSDictionary).

Yes, the syntax is ugly, but no doubt people will start using it in June...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2012-04-06 12:23:10 +00:00
parent 8ffddbc573
commit ecfd46edb2
7 changed files with 64 additions and 4 deletions

View file

@ -920,6 +920,11 @@ static SEL rlSel;
return nil;
}
- (id) objectAtIndexedSubscript: (size_t)index
{
return [self objectAtIndex: (NSUInteger)index];
}
- (NSArray *) objectsAtIndexes: (NSIndexSet *)indexes
{
//FIXME: probably slow!
@ -1921,6 +1926,11 @@ compare(id elem1, id elem2, void* context)
[self subclassResponsibility: _cmd];
}
- (void)setObject: (id)anObject atIndexedSubscript: (size_t)anIndex
{
[self replaceObjectAtIndex: (NSUInteger)anIndex withObject: anObject];
}
/** Replaces the values in the receiver at the locations given by the
* indexes set with values from the objects array.
*/