Can someone please post the code for implementing iAds with 4.0 and up and not showing them with other os versions.
What have you already tried? Have you followed the video from WWDC?
I've followed the video regarding hiding the iAd and animating it in. Which video talks about implementing iAds on multiple ios sdks?
That is the video I was referring to. I assumed it might well talk about it. As you did not say you'd viewed it then I did not know what you already knew. In that case it should be a simple case of weak-linking the framework and testing if the iAd framework is available at run time. This is well covered in the documentation
My problem is that the app is crashing in iPad and iPhone 3.1 and on. I weak linked the framework under target.
Christ this is hard work!
If it crashed then do you think it's more helpful to post the crash report or to not do so and leave us all guessing?
Edit to add: just in case you are not sure please try not to be a Help Vampire.
I am at the office now, can't look at my crash reports. It had something to do with not finding the iAds framework.
So did you read the link I posted about checking at runtime for the existence of methods/classes? You have weak-linked the framework so the runtime linker will let your app startup with unresolved symbols. But it is still your responsibility to not use any of the symbols that are not defined. So where you create your iAd view needs to be wrapped in a check to see if the Framework exists or not.
Class iAd = NSClassFromString(@"ADBannerView");
if (iAd) {
NSLog(@"iAds YAY");
} else {
NSLog(@"YUP NO IADS");
}
I have something like this in my code:
Code:Class iAd = NSClassFromString(@"ADBannerView"); if (iAd) { NSLog(@"iAds YAY"); } else { NSLog(@"YUP NO IADS"); }
Then we really need to see the crash report...
Yes, please. If you don't have enough information in front of you to troubleshoot an issue, then please resist the temptation to start a thread about it, and wait until you do. That just makes things easier for all of us. Thank you.Okeys, I will continue this when I get home.