24/7 twenty-four seven

iOS/OS X application programing topics.

Objective-C や Xcode の新しい機能のほとんどは iOS4 以前でも動く

Objective-C Feature Availability Index に一覧表が載ってるのですが、ARCのWeak Reference 以外は iOS 4 以上、ほとんどはすべての iOS バージョンで動くので、古い環境を気にせずにジャンジャン使ってしまってOKです。

新しいリテラルや Subscripting は断然コードが書きやすく読みやすくなるのでこれはうれしいですね。


Objective-C Feature Availability Index

FeatureTools versionsOS X deploymentiOS deployment
Automatic Reference Counting (ARC)Xcode 4.2
(LLVM Compiler 3.0)
Requires modern runtime
Deploys back to OS X v10.7
Deploys back to iOS 5
Automatic Reference Counting without zeroing weak reference (“ARCLite”)Xcode 4.2
(LLVM Compiler 3.0)
Requires modern runtime
Deploys back to OS X v10.6
Deploys back to iOS 4
Default synthesis of @property instance variables and accessor methodsXcode 4.4 (LLVM Compiler 4.0)Requires modern runtime
Deploys back to OS X v10.6
Deploys back to iOS 4
Instance variables in class extensionsXcode 4.2
(LLVM Compiler 3.0)
Requires modern runtimeAll iOS releases
Instance variables in @implementation blockXcode 4.2
(LLVM Compiler 3.0)
Requires modern runtimeAll iOS releases
No forward method prototypes needed in @implementation blockXcode 4.3
(LLVM Compiler 3.1)
All releasesAll iOS releases
NSNumber, NSDictionary and NSArray literalsXcode 4.4
(LLVM Compiler 4.0)
All releasesAll iOS releases
@YES and @NO literalsXcode 4.4 and OS X 10.8 or later SDK
Xcode 4.5 and iOS 6 or later SDK
(LLVM Compiler 4.0)
All releasesAll iOS releases
NSDictionary and NSArray subscriptingXcode 4.4 and OS X 10.8 or later SDK
Xcode 4.5 and iOS 6 or later SDK
(LLVM Compiler 4.0)
Requires modern runtime
Deploys back to OS X v10.6
Deploys back to iOS 4