App crashes on bannerViewDidLoadAd

Discussion in 'iOS Programming' started by themoonisdown09, Jan 31, 2011.

  1. themoonisdown09, Jan 31, 2011
    Last edited: Jan 31, 2011

    macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #1
    I have an iPhone app that seems to be crashing in the bannerViewDidLoadAd: method. It crashes on this line in the method:

    Code:
    banner.frame = CGRectOffset(banner.frame, 0, self.view.bounds.origin.y - 50);
    
    Here is the thread in the crash report:

    Now, before you tell me to release the iAd's delegate, I already am. In my dealloc method, I am doing this:

    Code:
    adBanner.delegate = nil;
    [adBanner release];
    
    This very frustrating because it looks like I am doing everything right. I was not having this error until a couple months after I released it with iAds. I would really appreciate the help.


    Edit: If it helps, I used Interface Builder to add the iAd. I've checked the code file to see if there was anywhere that I am releasing the adBanner, but there is not (except in the dealloc method).
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Have you tried invoking the debugger to investigate what the actual values of your variables are for this line?
     
  3. thread starter macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #3
    That's the problem, I can't recreate this crash when debugging on my device or in the simulator. I actually tested this app for a month on my device before I released it. Now, with real ads being pushed, it seems to crash.

    My only guess is that the adBanner is nil. I'm not sure how it could be though.
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Is there a difference between banner and adBanner?
     
  5. thread starter macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #5
    banner is the parameter in the bannerViewDidLoadAd: method.

    adBanner is the private variable which also has a property self.adBanner. The property is being retained.
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Well, since the line your error is occurring on makes no mention of adBanner, I don't think you need to suspect it.

    But since you can't recreate the crash, I'm not sure what I can say at this point. That really sucks and I hope that you are able to figure something out.
     

Share This Page