0

I am trying to load the mobile version of a site in a UIWebView on an iPad but I can only get it to load the desktop version. Am i doing something wrong?

NSString *urlAddress = @"http:www.kyfbnewsroom.com/2013-kentucky-farm-bureau-annual-meeting-program/";
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];
    [requestObj setValue:@"Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53" forHTTPHeaderField:@"User-Agent"];
    [webView loadRequest:requestObj];
raginggoat
  • 3,570
  • 10
  • 48
  • 108
  • One issue is `http:www.kyfbnewsroom.com....` should be `http://www.kyfbnewsroom.com...` – Popeye Jul 10 '14 at 12:29
  • Check this out: http://stackoverflow.com/questions/8542038/uiwebview-not-loading-mobile-version-of-site-with-loadrequest – ppolak Jul 10 '14 at 12:30
  • This could either be your navigate code or the fact that your side doesn't have a mobile/responsive version. Are you certain that one exists? – Popeye Jul 10 '14 at 12:32
  • @Popeye, yes there is a mobile version. That version loads on the iPhone. – raginggoat Jul 10 '14 at 12:49
  • @ppolak, the accepted answer to that question did not work. – raginggoat Jul 10 '14 at 12:55
  • Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/kyfbnews/public_html/wp-content/plugins/wptouch/core/mobile-user-agents.php on line 18 :) @ http:www.kyfbnewsroom.com .... – ppolak Jul 10 '14 at 14:00
  • I know. I was editing something and now this is happening. – raginggoat Jul 10 '14 at 14:03

0 Answers0