How can I launch Safari from an iPhone app?

keuminotti picture keuminotti · May 5, 2009 · Viewed 82.5k times · Source

This might be a rather obvious question, but can you launch the Safari browser from an iPhone app?

Answer

surtyaar picture surtyaar · Aug 27, 2009

should be the following :

NSURL *url = [NSURL URLWithString:@"http://www.stackoverflow.com"];

if (![[UIApplication sharedApplication] openURL:url]) {
    NSLog(@"%@%@",@"Failed to open url:",[url description]);
}