ViewController
- UIWebView:
webView
- a simply UIWebView - UIButton:
aboutButton
- takes you to the AboutViewController
AboutViewController
- UIButton:
websiteButton
- connected toclickWebsiteButton
- IBAction:
clickWebsiteButton
- dismiss AboutViewController, loadhttp://websiteURL.com/
inwebView
(which is within the ViewController)
AboutViewController Code
// AboutViewController.h
#import "ViewController.h"
@class ViewController;
@interface AboutViewController : UITableViewController <UIWebViewDelegate> {
ViewController *viewController;
}
// AboutViewController.m
-(IBAction)clickWebsiteButton:(id)sender {
[viewController.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://websiteURL.com/"]]];
[self dismissModalViewControllerAnimated:YES];
}
Question
I want to be able to load http://websiteURL.com/
within the UIWebView upon dismissing the view via the IBAction. As of now, all it does is dismiss the view but not load the URL within the WebView. The WebView is working and loading URL's properly, I'm just having troubles loading this URL from a different view. Any ideas?
Thanks