Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. [super viewDidLoad];
  4. _webView = [[UIWebView alloc] init];
  5. _webView.delegate = self;
  6. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:_url];
  7. [_webView loadRequest:request];
  8. }
  9.  
  10. NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", @"UserAgent", nil];
  11. [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
  12.  
  13. -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  14.  
  15. _webView = [[UIWebView alloc] initWithFrame:self.view.frame]; //give a proper Rect value
  16. _webView.delegate = self;
  17. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:_url];
  18. [_webView loadRequest:request];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement