How to open URL from iPhone application ?

By | June 18, 2011

Hi,

For opening a Web Link/URL from an iPhone application, follow the two simple steps.
Step 1 :
Create an NSURL object and initialize it with your URL string

 NSURL *myURL = [NSURL URLWithString:@"http://www.coderzheaven.com/"];

;

Step 2 :
Use the openURL method by passing your NSURL object

[[UIApplication sharedApplication] openURL: myURL];

Done. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *