Will weak linking the UIKit framework lead to rejection from the App Store?
I am getting issu开发者_运维问答es because of universal app for 3.1 to 4.2 iPhone / iPad devices. The problem is because of UIPopoverViewController not being present on older OS versions.
Can I weak link the UIKit framework? Will Apple reject the app if I use weak linking?
As of iOS 4.2, manual weak-linking is no longer required. All you probably have to do is switch to LLVM as your compiler. See Marco Arment's post Supporting older versions of iOS while using new APIs for details.
No, weak linking will not lead to a rejection from the App Store. It is a fully supported feature of the build environment (Apple even has a sample application that shows you how to use this). However, as Ole points out, this may not be needed going forward.
Many applications that are already on the store use weak linking to support previous OS versions, including all of mine. This answer of mine to a very similar question wouldn't have been found to be useful to people if Apple rejected applications doing this.
However, be sure to test on devices running the older OS versions you plan to support to verify that you didn't miss something when weak linking. Don't claim to support an older OS version if you've never tested your application against a device running it.
精彩评论