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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:49:18+00:00 2026-05-20T07:49:18+00:00

I’m new to this as I come from C++ and Perl background. Trying to

  • 0

I’m new to this as I come from C++ and Perl background. Trying to learn from books but they are missing some core concepts of Objective-C. I need some help on this code to pull a webpage:

RootViewController.m

    - (void)fetchWebsite:(NSString*)website{
    NSLog(@"address: %@", website);

    NSString *urlAddress = website;
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webImageDisplay loadRequest:requestObj];
    [webImageDisplay release];
}

- (void)viewDidLoad {
    [self fetchWebsite:@"website here"];
    [super viewDidLoad];
}

This code works just fine but what I’m having trouble is calling this method from another class, like the code below:

I’m correctly calling the detail view controller from a 2nd view controller like this:

SubViewController.m

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.
    switch (indexPath.row) {
        case 0: { 
            AnotherViewController *cViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherViewController" bundle:nil];
            cController.contentSizeForViewInPopover = CGSizeMake(320, 350);
            [self.navigationController pushViewController:cViewController animated:YES];
            [cViewController release];
            break;
        }
        case 1: {
            break;
        }
    }
}

Then I have a 3rd view controller that has the links to a new webpage which I want displayed on the webview. When I call the method here to access the function in RootViewController, it doesn’t seem to respond.

AnotherViewController.m

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *itemRequested = [conusItems objectAtIndex:indexPath.row];
    NSLog(@"logging: %@", itemRequested);

    RootViewController *parent = [[RootViewController alloc] init];
    [parent fetchWebsite:@"another website here"];

    [itemRequested release];

}

I click on the button on the table view and I see the code is being called in the RootViewController with the NSLog but it doesn’t seem to display the new page. No errors or warnings, Any ideas? Thanks

  • 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-20T07:49:19+00:00Added an answer on May 20, 2026 at 7:49 am

    If I may, you’re life will be easier and your application will be more flexible if you spin your web view out as it’s own view controller.

    The real problem is you aren’t navigating to your web view controller (and you might not be initializing it correctly.)

    Chances are the code will look more like this:

    MyWebViewController *webVC = [[MyWebViewController alloc] initWithNibName:@"MyWebViewContorller" bundle:nil];
    webVC.address = @"whatever";
    [self.navigationController pushViewController:webVC animated:YES];
    [webVC release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.