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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:34:48+00:00 2026-05-11T18:34:48+00:00

I’ve got a navigation controller based app that downloads an RSS feed and lays

  • 0

I’ve got a navigation controller based app that downloads an RSS feed and lays out the item titles in a TableView. That part works. When I click on an article title, I want to push an instance of my FeedArticleController onto the navigation stack. The FeedArticleController loadView method sets up the views (since I want to learn how to do this programmatically instead of using IB). Here’s the loadView:

- (void)loadView {
    UIView *view = [[UIView alloc] init];
    self.view = view;

    webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    webView.delegate = self;

    [view addSubview:webView];
}

Does that make sense?
Now, to make the webView actually load the page, I have this viewDiDLoad method:

- (void)viewDidLoad {
    [super viewDidLoad];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]]; 
}

And then I have the delegate methods, webViewDidStartLoad and webViewDidFinishLoad. They just print to NSLog.

Am I missing something in how I constructed and added the views? The delegate methods seem to be printing to the log after a delay and there is traffic on the line when the webView is instantiated. So, I think it is loading the page, but not being displayed?

Thanks guys.

  • 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-11T18:34:48+00:00Added an answer on May 11, 2026 at 6:34 pm

    There are two things to look into here:

    1. Setting the web view’s autoresizingMask to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight to make the web view resize when its parent is resized. This is because by default both the parent UIView you’ve created and the UIWebView have zeroed frames (0,0,0,0). By setting this, when the parent is resized prior to going onscreen the web view will be resized to match.
    2. Don’t use a separate UIView instance, just set self.view to your UIWebView instance.

    I’d recommend the second option, unless you really need another view inside your controller. Also, I should point out here that you’re leaking both the UIView and the UIWebView inthe code snippet above. That might be simplified, but in case it isn’t, you should release the views after assigning them. Here’s an example implementing solution 2 above:

    - (void) loadView
    {
        webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
        webView.delegate = self;    // weak reference: doesn't retain self
        self.view = webView;        // strong reference: retains webView
        [webView release];          // release initial reference: now 'owned' through self.view
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I use sqlite for desktop apps that need a good… May 11, 2026 at 11:58 pm
  • Editorial Team
    Editorial Team added an answer Built-in ASP.NET MVC validation is server-side only so there is… May 11, 2026 at 11:58 pm
  • Editorial Team
    Editorial Team added an answer See code below. Replace my print statements with what you… May 11, 2026 at 11:57 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.