UIWebView doesn't update
I am using UIWebView loadRequest to request a new URL. The UIWebView is inside a TabBar View. When I place the request inside awakeFromNib it works. When a make a subsequent call the开发者_StackOverflow社区 view does not change.
[webDisplay loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
If I place the initial request inside viewDidLoad instead of awakeFromNib it also doesn't seem to work.
I note that if I track request by delegating shouldStartLoadWithRequest this method also doesn't seem to be called by this loadRequest call.
Tabbar view controllers are loaded only once i.e when a particular tab is selected for the first time. So, viewDidLoad and awakeFromNib are only called once.
You need to call loadrequest in viewDidAppear method for the webview to be reloaded with latest content whenever that particular tab is selected.
精彩评论