How can I launch Safari from an iPhone app?

ios, launch, safari

Solution

should be the following :

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

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

Problem

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

Original source