iAds for iOS4 and nothing for other iOS

Discussion in 'iPhone/iPad Programming' started by insomnie, Aug 3, 2010.

  1. macrumors member

    Joined:
    Apr 5, 2010
    #1
    Can someone please post the code for implementing iAds with 4.0 and up and not showing them with other os versions.
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    What have you already tried? Have you followed the video from WWDC?
     
  3. thread starter macrumors member

    Joined:
    Apr 5, 2010
    #3
    I've followed the video regarding hiding the iAd and animating it in. Which video talks about implementing iAds on multiple ios sdks?
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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
     
  5. thread starter macrumors member

    Joined:
    Apr 5, 2010
    #5

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

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    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.
     
  7. thread starter macrumors member

    Joined:
    Apr 5, 2010
    #7
    I am at the office now, can't look at my crash reports. It had something to do with not finding the iAds framework.
     
  8. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    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.
     
  9. thread starter macrumors member

    Joined:
    Apr 5, 2010
    #9
    I have something like this in my code:

    Code:
    	Class iAd = NSClassFromString(@"ADBannerView");
    	if (iAd) {
    		NSLog(@"iAds YAY");
    		
    	} else {
    		NSLog(@"YUP NO IADS");
    	}
     
  10. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    Then we really need to see the crash report...
     
  11. thread starter macrumors member

    Joined:
    Apr 5, 2010
    #11
    Okeys, I will continue this when I get home.
     
  12. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    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. :)
     

Share This Page