UserAgentの取得と変更 [Xcode]
//webviewからUserAgentを取得
UIWebView * webView = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease];
NSString * userAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
//UserAgentの変更( " Add Test UIWebview" という文字列を追加)
userAgent = [userAgent stringByAppendingString:@" Add Test UIWebView"];
NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:userAgent, @"UserAgent", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
NSLog(@"UserAgent : %@", userAgent);