advantis
10/15/2013 - 8:09 AM

Thoughts about a bit more formal approach to indexed/keyed subscripting

Thoughts about a bit more formal approach to indexed/keyed subscripting

@protocol ADVIndexedSubscripting <NSObject>
- (id) objectAtIndexedSubscript:(NSUInteger)index;
@end

@protocol ADVMutableIndexedSubscripting <ADVIndexedSubscripting>
- (void) setObject:(id)object atIndexedSubscript:(NSUInteger)index;
@end

@protocol ADVKeyedSubscripting <NSObject>
- (id) objectForKeyedSubscript:(id)key;
@end

@protocol ADVMutableKeySubscripting <ADVKeyedSubscripting>
- (void) setObject:(id)object forKeyedSubscript:(id <NSCopying>)key;
@end