Removing Code Linking for Different Targets in XCode - iAds
I have an app I am working on which has been split into two targets, one for the iPhone and one for the iPad. The iPhone side (w/iAds) runs perfectly, but the iPad target gives me errors. It basi开发者_如何学Ccally boils down to the iPad target not recognizing the iAd framework.
I've tried weak linking but I still get iAd/iAd.h: No such file or directory
as an error. Obviously iAds can't be run on the iPad but I at least need my code to compile.
Am I missing some blatantly obvious solution here?
The iAd framework — including the headers — does not exist prior to 4.0.
You could try
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 // 40000 == __IPHONE_4_0
#include <iAd/iAd.h>
#endif
to ensure the iAd framework is not included when compiling for 3.2 SDK.
i think i found a better way... you have to setup "weak" not required in the frameworks for targets.
精彩评论