Skip to content

Instantly share code, notes, and snippets.

@advantis
Created October 15, 2013 08:09
Show Gist options
  • Save advantis/6988180 to your computer and use it in GitHub Desktop.
Save advantis/6988180 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment