mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
8ffddbc573
commit
ecfd46edb2
7 changed files with 64 additions and 4 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue