UIWebView Loading content properly on iOS 6 simulator but not on device?
Posted
by
David Hegner
on Stack Overflow
See other posts from Stack Overflow
or by David Hegner
Published on 2012-09-29T23:53:15Z
Indexed on
2012/09/30
3:37 UTC
Read the original article
Hit count: 172
I have encountered a weird bug with a released app. My UIWebView is no longer loading content on iOS 6, yet the content still displays in the simulator. The activity indicator displays properly but then it loads a blank url? Again, this only happens on a device, not on the simulator.
To provide extra context (in the simulator the NSURLRequest is assigned the proper URL. When run on a device the value is nil.)
Here is my code :
-(void)loading
{
if(!self.webView.loading)
[self.activityIndicator stopAnimating];
else {
[self.activityIndicator startAnimating];
}
}
- (void)viewDidLoad
{
[self.webView addSubview:self.activityIndicator];
NSURLRequest *requestUrl = [NSURLRequest requestWithURL:self.url];
[self.webView loadRequest:requestUrl];
self.timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(loading) userInfo:nil repeats:YES];
[super viewDidLoad];
NSLog(@"%@", requestUrl);
}
© Stack Overflow or respective owner