Skip to content

Instantly share code, notes, and snippets.

@steipete
Created June 21, 2012 02:16
Show Gist options
  • Save steipete/2963457 to your computer and use it in GitHub Desktop.
Save steipete/2963457 to your computer and use it in GitHub Desktop.
Allow subscripting on iOS4/5 with Xcode 4.4 (not needed when using 4.5/iOS 6 SDK)
// Add support for subscripting to the iOS 5 SDK.
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSObject (PSSubscriptingSupport)
- (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