Skip to content

Instantly share code, notes, and snippets.

@zeroelink
Created August 17, 2012 04:15
Show Gist options
  • Save zeroelink/3375873 to your computer and use it in GitHub Desktop.
Save zeroelink/3375873 to your computer and use it in GitHub Desktop.
iOS Subscripting
//
// NSObject+subscripts.h
// Created by Martin Santiago on 7/26/12.
//
#import <Foundation/Foundation.h>
// Add support for subscripting to the iOS 5 SDK.
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSObject (subscripts)
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
- (id)objectForKeyedSubscript:(id)key;
@end
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment