WebView not responding when called from a method
Posted
by AragornSG
on Stack Overflow
See other posts from Stack Overflow
or by AragornSG
Published on 2010-04-18T11:16:09Z
Indexed on
2010/04/18
11:23 UTC
Read the original article
Hit count: 188
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!
© Stack Overflow or respective owner