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 8378677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:58:56+00:00 2026-06-09T15:58:56+00:00

I have implemented iAds into my app successfully in one particular view controller, and

  • 0

I have implemented iAds into my app successfully in one particular view controller, and I want to put them in many of my other view controllers. It seems redundant to write the same iAd code over and over each again for each view controller. I want to be able to put all this code for iAds in one class and just call it whenever I need it. So I have heard of things called helper classes and class methods(+) but I am not sure if this what I need. Can anyone lead me in the right direction? An example would be helpful.

Edit

I created a singleton class without a view controller and I think thats right. Anyways in the iAd implementation, there are many lines of code that include adding a subview such as

[self.view addSubview:adView]; 

The singleton is telling me that it does not recognize "view". So when I am calling the singleton from my other view controllers, do I need to pass the view to the singleton? Thank you

  • 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-06-09T15:58:57+00:00Added an answer on June 9, 2026 at 3:58 pm

    Your new class, the iAd singleton, does indeed not have a view; thus you cannot access one from there.

    I would suggest that, rather than passing the view controller’s view to the iAd class, you have your VCs request the ad. Something like this:

    // SomeViewController
    // Maybe this is viewDidLoad? It's wherever you are ready to 
    // incorporate the ad into your view.
    - (void) arrangeViewIncludingAds
    {
        // Do other setup
    
        UIView * adView [[iAdSingleton sharedIAd] adWithParameters:infoToSelectAnAppropriateAdForThisVC];
        [self.view addSubview:adView];
    
        // Continue setup
    }
    

    I’m not sure if you want to change the ads for each VC or not; I just added that as an idea.

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

Sidebar

Related Questions

I have implemented Facebook into my app but now I find that whenever I
I have implemented the Google map successfully. But one more thing has left to
I have implemented one application in android which uses epublib to view .epub files.
Ok so I implemented iAds into my current app. Problem is how do I
I've just implemented iAds in an app with several distinct UIViewControllers. I have the
I have implemented admob in my iPhone app, but the view which was created
I have implemented a table view with multiple threads. Currently when a user taps
I have implemented one matrix multiplication with boost::numeric::ublas::matrix (see my full, working boost code
i have implemented galleryview in one screen named display_image.xml in which i have shown
I have implemented a test app with Android's In-App Billing. I have filled in

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.