iOS Force embedded website in classic view? (xcode)

Thelle93

macrumors newbie
Original poster
Oct 7, 2012
18
0
Hi!
Im developing an iphone app in Xcode 4.5 and im wondering if it is possible to force a website url that is embedded with UIWebView to load into classic mode instead of mobile view? (it's a Facebook page that doesn't work well in mobile mode).

Thanks in advance! :)
 

Thelle93

macrumors newbie
Original poster
Oct 7, 2012
18
0
Thanks it worked! :D

here's the code:

Code:
+ (void)initialize {
    NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Classic", @"UserAgent", nil];
    [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
}
 
Last edited by a moderator:

idelovski

macrumors regular
Sep 11, 2008
235
0
I was always sure you should do it with "User-Agent" header on the request. It's not that I ever tried to do it, but now I did a google search and found this:

Stack Overflow - Change User Agent in UIWebView (iPhone SDK)

I can see several issues, one of them being Note that you need to use @"User-Agent" to read the property, but @"User_Agent" to set it.

Oh, well.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.