I set the user agent using the method described, but it does not work. The only method I have found to work has been:
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"My User Agent", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];