Open URL in Safari


 / Published in: Objective C
 

URL: http://www.iphonedevsdk.com/forum/iphone-sdk-development/3927-open-safari.html

This is the way to open a specific URL in the Mobile Safari of the iPhone

  1. NSURL *url = [ [ NSURL alloc ] initWithString: @"http://www.cnn.com" ];
  2. [[UIApplication sharedApplication] openURL:url];

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: daknok on June 11, 2011

Be sure to release url or there'll be a memory leak.

You need to login to post a comment.