PDA

View Full Version : iAds for iOS4 and nothing for other iOS




insomnie
Aug 3, 2010, 08:15 AM
Can someone please post the code for implementing iAds with 4.0 and up and not showing them with other os versions.



robbieduncan
Aug 3, 2010, 08:18 AM
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?

insomnie
Aug 3, 2010, 08:20 AM
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?

robbieduncan
Aug 3, 2010, 08:24 AM
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 (http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-1114537-BABHHJBC)

insomnie
Aug 3, 2010, 08:27 AM
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 (http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-1114537-BABHHJBC)


My problem is that the app is crashing in iPad and iPhone 3.1 and on. I weak linked the framework under target.

robbieduncan
Aug 3, 2010, 08:28 AM
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 (http://slash7.com/2006/12/22/vampires/).

insomnie
Aug 3, 2010, 08:35 AM
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 (http://slash7.com/2006/12/22/vampires/).

I am at the office now, can't look at my crash reports. It had something to do with not finding the iAds framework.

robbieduncan
Aug 3, 2010, 08:38 AM
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.

insomnie
Aug 3, 2010, 08:40 AM
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:

Class iAd = NSClassFromString(@"ADBannerView");
if (iAd) {
NSLog(@"iAds YAY");

} else {
NSLog(@"YUP NO IADS");
}

robbieduncan
Aug 3, 2010, 08:41 AM
I have something like this in my code:

Class iAd = NSClassFromString(@"ADBannerView");
if (iAd) {
NSLog(@"iAds YAY");

} else {
NSLog(@"YUP NO IADS");
}

Then we really need to see the crash report...

insomnie
Aug 3, 2010, 08:46 AM
Then we really need to see the crash report...

Okeys, I will continue this when I get home.

dejo
Aug 3, 2010, 10:31 AM
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. :)