public
Created

Special methods for adding subscripting

  • Download Gist
special_methods.m
Objective-C
1 2 3 4 5 6 7
// To add array style subscripting:
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; // setter
- (id)objectAtIndexedSubscript:(NSUInteger)idx; // getter
 
// To add dictionary style subscripting
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key; // setter
- (id)objectForKeyedSubscript:(id)key; // getter

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.