1

It might seem duplicate to you, but as long as my problem is not solved I should ask here for help. I have tried previous given answers but nothing is working for me. So please help me out.

I want to force my UIWebView to load desktop versions of all websites(not the mobile version) and I am using this code, but still I am getting mobile versions of websites.

NSURL *urlValue = [NSURL URLWithString:@"any url here"];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:urlValue];
    NSString *newUserAgent = @"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7";
    [request setValue:newUserAgent forHTTPHeaderField:@"User_Agent"];
    [webView loadRequest:request];

There might be some problem with my User_Agent string. So your kind help is required.

Ghazanfar Ali
  • 123
  • 1
  • 9
  • Maybe set the value for header field: @"User-Agent"? See: http://stackoverflow.com/questions/478387/change-user-agent-in-uiwebview-iphone-sdk#comment4645987_1368399 – SushiGrass Jacob May 16 '12 at 13:46
  • But I think that we need to use @"User-Agent" to read the property, but @"User_Agent" to set it. – Ghazanfar Ali May 17 '12 at 06:15

0 Answers0