General answer
Yes, apps can be made backwards compatible with iOS5 or earlier. “Can be” being the important catch here — doing so can be very time consuming, depending on what your application does, what APIs it uses, etc. On the other handle, quite simple projects can just work, if they use very standard APIs available without much change since the beginning of (iOS) time.
Obviously if your app uses iOS6 only features, you’re stuck. Otherwise, yes, you can do it, but be prepared to take time doing so — not only writing/alterting code, but testing it.
So as far as you’re concerned, yes, the project is ‘broken’, by which we mean not written for older versions of iOS. If only it were as simple as changing a project setting!
Here’s a few strategies for making backwards-compatible apps:
-
Where variants on an API exist, with different methods having different compatability, use the most compatible variants. For example, some
NSFileManager
methods appeared in newer versions of iOS, but older variations will still work. Apple tend to willy-nilly publish source code (IME) that uses the newer code without any proviso about “BTW, this won’t work on older versions of iOS” so care is needed -
If you want to make some functionality only appear on newer iOS versions, you need to do a run-time check that the desired methods/APIs are available, and only use them when they are. In these cases you also need to be careful linking your project and ‘weak link’ some items.
-
If you really need iOS3 compatability, you can’t use ARC; it has to be old-style memory management. iOS4 supports ARC, but a few runtime limitations: auto-nilling of references isn’t supported.
Movie playing is a classic example of newer and better APIs being available but older APIs still being around. The older MPMoviePlayerController
was pre-iOS4, then MPMoviePlayerViewController
appeared in iOS4 (note the word ‘view’ — it’s a fully fledged UIViewController
). Typically you want to use the latter, but for iOS3 compatability you’d decide to use the former based on a runtime check.
Specific answer
Your problem with CV_XADD
: this looks like a preprocessor definition that is #define
d somewhere but the compiler isn’t picking it up. For a hint, try looking for the definition of CV_XADD
by searching for #define CV_XADD
. IF you can’t find that, try looking for just CV_XADD
and looking for a definition in all the results.
Have you tried googling for the terms ‘CV_XADD expected expression’? I get a number of hits relating to this problem.
Your project is using C++ which adds some more complexity to the mix!
3
solved making ios 6 app project compatible with iOS 5 – backwards