I\'m not talking about a UIWebView, I want to open the mobile safari app using an NSURLRequest.
Why? In my app, the user has already logged
It would be simpler to use an NSURL, or just an NSString, or just a char* for that matter. I'm not sure if that works on the iPhone, it should, since the iPhone runs parallel with Darwin just like OSX, but there are some restrictions to that on the iPhone. This definitely works on a mac though.
NSString *url = @"http://www.apple.com";
NSURL *myURL = [NSURL URLWithString:url];
system([ [NSString
stringWithFormat:@"Open -a Safari %@",
[NSString stringWithContentsOfURL:myURL encoding:NSUTF8StringEncoding error:NULL] ]
cStringUsingEncoding:NSUTF8StringEncoding]);
Also, I might suggest that that's a bad idea (if it might be avoided). As an iPhone user, I'm sure I'm not alone in finding it very irritating when developers take me away from the app I'm currently in.