Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6759923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:00:30+00:00 2026-05-26T14:00:30+00:00

I am having an iphone app with admob on two screens’s viewdidLoad My code

  • 0

I am having an iphone app with admob on two screens’s viewdidLoad

My code is:

AbMob =[[GADBannerView alloc]initWithFrame:CGRectMake(0.0,self.view.frame.size.height-195, 320, 50)];

    AbMob.adUnitID = AdMob_ID;
    AbMob.rootViewController = self;
    [self.view addSubview:AbMob];



    GADRequest *r = [[GADRequest alloc] init];
    r.testing = NO;

    [AbMob loadRequest:r];

Problem is this code works fine on one screen but crashes on other screen with error

* -[GADOpener didOpen]: message sent to deallocated instance
0x6074750

Can anybody tell me what could be the problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:00:31+00:00Added an answer on May 26, 2026 at 2:00 pm

    You have a retain/release problem somewhere in your code. You say it works in one view, but not another – this makes me believe that you are storing this instance outside of your view controllers. The message sent to deallocated instance issue is due to you trying to use a variable that has been removed from memory somewhere in the code before this error pops up. You need to ensure that the view controller that is creating this object is properly retaining it so that it does not get deallocated before you need to use it again with:

    GADBannerView *_adMobBannerView;
    
    @property(nonatomic,retain) GADBannerView *adMobBannerView; //view controller retains object when using self.adMobBannerView = bla
    

    It sounds like you may need to brush up on your memory management documentation, but the gist of it is that anywhere you are calling alloc, you are managing that memory and need to call release when you are done with it. If you need a variable to stick around for longer than an autoreleased object is living for, then you need to create an instance variable and retain the object yourself with ivar properties @property (nonatomic, retain).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an annoying problem with my iPhone app. Whenever I set the optimization
I just created an iPhone app and am having friends try it out, but
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
I'm working on an iPhone app, and I'm having some compiler trouble. Here's the
I track user activity in my iPhone app by having certain user actions call
I am having an issue with my UITextFields in my iPhone app that I
I am building a core data iphone app, and having trouble with retrieving one-many
I'm having some strange behaviour ocurring when I try to run my Iphone app
In the iPhone app I'm currently working on, I'd like two view controllers (I'll
I am having my iPhone app delete a selected image off of my database,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.