views:

107

answers:

1

My question is this: in many free iPhone apps adds which are basically imageViews are buttons. When pressed, they bring you to the iphone App store to buy whichever app was advertised. Can this be tweaked to open a hyperlink in the iphone's safari browser? and if so, how?

A: 

The App Store links are already simple hyperlinks, but the system notices that they point to the app store and opens the App Store app right away. The links are opened using the openURL: method of the UIApplication class:

NSURL *url = [NSURL URLWithString:@"http://www.stackoverflow.com/"];
[[UIApplication sharedApplication] openURL:url];
zoul
so should I put this under an IBAction, and make the imageView a Button?
kevin Mendoza
Yes, that sounds like a good solution.
zoul