I’m aware that with Xcode now, it is recommended to use ARC, however I’ve read a bit about it not being compatible with iOS 4.x, at least when using __weak. When I create an IBOutlet it gives the choice of weak or strong as the storage type, does this mean my application is limited to iOS 5 or above, or will it still run on an older iOS?
I’m aware that with Xcode now, it is recommended to use ARC, however I’ve
Share
Definitely just use ARC. As you point out, if you elect to provide iOS 4.3 compatibility, you don’t enjoy that one little benefit feature of
weakvariables, where they’d be automaticallynil-ed for you when they’re deallocated (but you don’t have that feature in non-ARC code, so it’s not like you’re losing anything). And, yes, when you control-drag from Interface Builder to the .h file, it says you have only thestrongandweakoptions, but in the latest Xcode, at least, if you have iOS 4.3 as a target and you chooseweak, it will automatically create it for you as a__unsafe_unretained, so all is good.In short, use ARC, even if you’re targetting support for iOS 4.3, and your coding life will be considerably better than if you didn’t use ARC. Even in iOS 4.3, you get so many wonderful ARC benefits. And if you are willing to use iOS 5.0 as your target deployment, then you enjoy the full benefits of ARC.
If you use Xcode 4.5, you do, admittedly lose support for armv6, the processor for the iPhone 3G and earlier, so your app will only support the iPhone 3GS and later.