如何让自定义类支持下标访问

- (id) objectAtIndexedSubscript: ( NSUInteger ) idx ;
- (void) setObject: ( id ) obj atIndexedSubscript: ( NSUInteger ) idx ;
- (void) setObject: ( id ) obj forKeyedSubscript: ( id < NSCopying > ) key ;
- (id) objectForKeyedSubscript: ( id ) key ;

我找到的是这个帖子:

http://petersteinberger.com/blog/2012/using-subscripting-with-Xcode-4_4-and-iOS-4_3/


你可能感兴趣的:(c,数组,objective,下标)