public
Created

If you want to add the new array/dictionary accessors to IOS5

  • Download Gist
new_accessors.m
Objective-C
1 2 3 4 5 6 7 8 9 10 11 12 13
// Put this in your ..-Prefix.pch file
 
// Add support for subscripting to the iOS 5 SDK.
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSObject (SubscriptingSupport)
 
- (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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.