Created
July 26, 2012 00:46
-
-
Save nakiwo/3179598 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Xcode4.4 | |
// llvm4の機能のうち一部が、 | |
// iOS 5.1 SDK で使えない | |
// 例 | |
NSNumber *b = @YES; // error | |
NSArray *array = @[ @1, @2, @3 ]; | |
NSNumber *n = array[1]; // error | |
// 対処 (自己責任で) | |
#if __has_feature(objc_subscripting) | |
@interface NSArray (HOGEHOGE) | |
- (id)objectAtIndexedSubscript:(NSUInteger)idx; | |
@end | |
@interface NSMutableArray (HOGEHOGE) | |
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; | |
@end | |
@interface NSDictionary (HOGEHOGE) | |
- (id)objectForKeyedSubscript:(id)key; | |
@end | |
@interface NSMutableDictionary (HOGEHOGE) | |
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key; | |
@end | |
#endif | |
#if __has_feature(objc_bool) | |
#undef YES | |
#undef NO | |
#define YES __objc_yes | |
#define NO __objc_no | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment