2011年10月1日土曜日

UIWebViewのUserAgentを変更する

    NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Your desired user agent", @"UserAgent", nil];

    [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];

    [dictionnary release];

条件
1.UIWebiewをallocする前に実行する必要がある
2.ひとつのUIWebviewで複数の値を切り会えることはできない(もしくは難しい)

0 件のコメント: