As per my knowledge ARC is available from iOS SDK version 5. So if you are writing an Objective C code using ARC syntax/features...how does one ensure that it works on the prior version of iOS ?
Asked
Active
Viewed 58 times
0
-
4Are you asking how to write iOS 4 compatible code—in 2014? – Nikolai Ruhe Jul 10 '14 at 17:55
-
If you are writing a new app now, you should only support iOS 7 and later. – rmaddy Jul 10 '14 at 18:02
-
You should not worry about ARC support. – Léo Natan Jul 10 '14 at 18:06
-
These are valid points. iOS4 has to be a fraction of a percent of the total iOS market at this point. It doesn't even register [here](https://mixpanel.com/trends/#report/ios_frag). A year ago it was [less than 4%](http://appleinsider.com/articles/13/12/05/apple-pegs-ios-7-distribution-at-74-ios-6-at-22). – i_am_jorf Jul 10 '14 at 18:36
-
You can write it without ARC, that's still absolutely possible. – Sulthan Jul 10 '14 at 18:51
1 Answers
1
Well... #ifdef
s, lots of #ifdef
s.
For example, from twitter-text-objc:
...
#if !__has_feature(objc_arc)
[entity autorelease];
#endif
return entity;
}
Here's an answer you may find relevant.