在iPad WebView上打开移动网站

时间:2014-07-10 12:24:45

标签: ios ipad uiwebview nsmutableurlrequest

我正在尝试在iPad上的UIWebView中加载网站的移动版本,但我只能加载桌面版本。我做错了吗?

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];

0 个答案:

没有答案