1. Due to the recent site upgrade, the iPadForums (iPF) App will no longer work. The new iPadForums.net website has been designed from the ground up to work perfectly from any mobile, tablet, or desktop computer using the built in internet browser. Create a shortcut to iPadForums.net on your home screen by following these steps: Create an icon for iPadForums.net

Calling Webview from anther View Controller class

Discussion in 'iPad Development' started by ray10, Feb 24, 2011.

  1. ray10

    ray10 iPF Noob

    Feb 24, 2011
    Thanks Received:
    Trophy Points:
    +0 / 0
    Hi everyone, 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:

    - (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:

    - (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. Any ideas? Thanks

Share This Page

Search tags for this page

change webview from didselectrowatindexpath


didselectrowatindexpath call uiwebview