should be the following :
NSURL *url = [NSURL URLWithString:@"http://www.stackoverflow.com"];if (![[UIApplication sharedApplication] openURL:url]) { NSLog(@"%@%@",@"Failed to open url:",[url description]);}
UIApplication has a method called openURL:
example:
you can open the url in safari with this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.google.com"]];