Automatic Reference Counting on iOS 3.x

2019-07-18 20:11发布

Does an app compiled with arc turned on work with iOS 3.1.x devices? Ideally I would like to make our app work only with iOS 4.x and higher but we have some users still running iOS 3.x. I no longer have access to devices with iOS 3.

Has anyone tested?

3条回答
够拽才男人
2楼-- · 2019-07-18 20:29

ARC is only available on iOS 4.0 and above. Additionally automatic real reference nil-ing is only available on iOS 5.0 and above.

查看更多
混吃等死
3楼-- · 2019-07-18 20:38

I wouldn't count on ARC working back to iOS 3.x until you've at least found official documentation to that effect and perhaps tested it yourself as well. Here's at least one opinion that supports the notion that apps written using ARC may not even work on all versions of iOS 4.

查看更多
Juvenile、少年°
4楼-- · 2019-07-18 20:42

If you set the deployment target to pre 5.0 the compiler will automatically insert the memory management (retain/release) for you. So yes, it will work.

查看更多
登录 后发表回答