Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

insomnie

macrumors member
Original poster
Apr 5, 2010
67
0
Can someone please post the code for implementing iAds with 4.0 and up and not showing them with other os versions.
 
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
 
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.
 
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.
 
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.

I have something like this in my code:

Code:
	Class iAd = NSClassFromString(@"ADBannerView");
	if (iAd) {
		NSLog(@"iAds YAY");
		
	} else {
		NSLog(@"YUP NO IADS");
	}
 
Okeys, I will continue this when I get home.
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. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.