WebView not responding when called from a method
- by AragornSG
I have an app with tabbar and webview. I'm trying to make the app come back to default url each time user taps the bar. Right now I'm intercepting taps and launching a method, however it's not affecting my webview. The same syntax for calling webview from awakeFromNib works, so I don't have a clue what's up. I suspect it's something to do with how I call the method, but I don't know what.
Here is the code:
#import "SecondViewController.h"
@implementation SecondViewController
- (void)awakeFromNib
{
NSString *loadURL = [NSString stringWithFormat:@"http://pageurl"];
// [secondView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:loadURL]]];
SecondViewController *ptr = [[SecondViewController alloc] init];
[ptr goToPage];
}
- (void) goToPage
{
NSLog(@"go to page");
NSString *newURL = [NSString stringWithFormat:@"http://pageurl"];
[secondView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:newURL]]];
}
Thanks fot your help!