0

This is probably a simple question...

I have a UIView with a button that corresponds to a URL address http:// etc. I want to be able to click this web address button and have it load a UIWebView on a separate UIViewController and XIB that shows the website, allowing me to then hit a back button and go back to my first view that has the original button. Basically I want to be able to load the webpage but have it operate within the App rather than start up Safari. Is this possible?

So far I have build a dedicated XIB and ViewController for my webpage for which the viewDidLoad method looks like this:

  - (void)viewDidLoad{  
  [super viewDidLoad];  
NSString *urlAddress = pushURL; //pushURL is passed as parameter 

NSURL *url = [NSURL URLWithString:urlAddress];

NSURLRequest *requestObject = [NSURLRequest requestWithURL:url];

[webView loadRequest:requestObject];  
[addressBar setText:urlAddress];
 }

Question is... how do I call the UIWebView from my button (which is in the first class/parent viewController)? All my other viewControllers in my app are using UITableView so it's a simple DidSelectRowAtIndex.

Thanks.

1 Answer 1

0

It sounds like you want to be using a UINavigationController. Then when the button is tapped just push the UIViewController with the web view to the UINavigationController.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.