put in didLoad of your viewController that contain uiwebview
myWebview.delegate = self;
where myWebview is your webview.
now add this method
Code:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)req navigationType:(UIWebViewNavigationType)navigationType {
NSMutableURLRequest *request = (NSMutableURLRequest *)req;
if ([request respondsToSelector:@selector(setValue:forHTTPHeaderField:)]) {
[request setValue:[NSString stringWithFormat:@"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"] forHTTPHeaderField:@"User_Agent"];
}
return YES;
}
now when loading some page with that uiwebview, you should see the iphone version.