/ Published in: Objective C
simple snippet to open url with an ibaction in safari
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (IBAction)LauchURLAction:(id)sender { NSLog(@"***[STARTING] - open URL in Safari "); [self launchURL:@"http://www.someurl.com"]; } { NSLog(@"***[STARTING] - launch url "); urlToOpen = [urlToOpen stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; if (![[UIApplication sharedApplication] openURL:url]) NSLog(@"%@%@", @"Failed ton open url:",[url description]); }