Welcome to iPadForums.net Guest - Click Here to Register

Calling Webview from anther View Controller class

This is a discussion on Calling Webview from anther View Controller class within the iPad Development forums, part of the iPad App Store category; 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 ...

Register with iPad Forums
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    iPad Noob!
    Member #
    35383
    Join Date
    Feb 2011
    Posts
    1

    Calling Webview from anther View Controller class

    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:

    RootViewController.m
    Code:
    - (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:

    AnotherViewController.m
    Code:
    - (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



Home | Forum | Active Topics | What's New

Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Replies: 2
    Last Post: 02-18-2011, 05:44 AM
  2. Calling all car smart people!!
    By SweetPoison in forum Off-Topic
    Replies: 20
    Last Post: 01-21-2011, 09:23 PM
  3. Lisbon calling...
    By Lisbon Lion in forum New Member Introductions - Site Assistance
    Replies: 2
    Last Post: 11-05-2010, 01:07 AM
  4. Calling everyone for some help to a newbie!!
    By bigkevj in forum iPad General Discussions
    Replies: 4
    Last Post: 09-22-2010, 02:13 PM
  5. Calling Out All Artists: Stylus To Recommend?
    By Ultrimate in forum iPad General Discussions
    Replies: 7
    Last Post: 06-23-2010, 04:58 PM

Search tags for this page

call method from another view controller
,

call webview from tableview

,
call webview on another viewcontroller
,
calling a class from a controller objective c
,
calling methods from the class to the controller objective c
,
calling webview from table view
,
how to access a parent view controller from a webview
,
how to call function from other viewcontroller
,
how to call out webview in tableview
,
ios reload webview from different class
,
ios tableview call webview
,
ipad development call another class
,

iphone c+ class get view controller

,
iphone webview reload from different class
,

obj-c+call+function+in+other viewcontroller

,
objective c parent view controller
,

splitview controller function call for rootviewcontroller

,

view controller webview

,
webview in split view controller
,
webview in tableview
Click on a term to search for related topics.