参考:http://www.mphweb.com/en/blog/easily-set-user-agent-uiwebview
添加个方法:
+ (void)initialize {
// Set user agent (the only problem is that we can't modify the User-Agent later in the program)
NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@" 自定义字符串", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
}