Custom Subscripting
suggest changeYou can add subscripting to your own classes by implementing the required methods.
For indexed subscripting (like arrays):
- (id)objectAtIndexedSubscript:(NSUInteger)idx
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx
For keyed subscripting (like dictionaries):
- (id)objectForKeyedSubscript:(id)key
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents