PDA

View Full Version : iPhone SDK - create a button with URL to open Safari




steveclv
Mar 31, 2008, 06:50 PM
I'm wading through gigabytes of SDK docs but I can't see an example of how to assign a URL held in a variable to a button so that when the user presses it, Safari opens the web page.

Must be so simple that Apple didn't think we needed an example but I'm afraid I can't see how to do it with this new version of C.

Thanks for any help



Monkaaay
Mar 31, 2008, 08:11 PM
I have a difficult time finding information in their docs as well. I'm really hoping this gets better by June.

springframework
Mar 31, 2008, 08:20 PM
a good thing for them to do would be to include all inherited methods/properties in the class documentation.

iphoneGuy
Mar 31, 2008, 09:21 PM
I'm wading through gigabytes of SDK docs but I can't see an example of how to assign a URL held in a variable to a button so that when the user presses it, Safari opens the web page.

Must be so simple that Apple didn't think we needed an example but I'm afraid I can't see how to do it with this new version of C.

Thanks for any help

Check out the launch me sample....

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.apple.com"]];

ElNono
Apr 1, 2008, 08:43 AM
Two helpful tidbits about documentation and contextual help.
1) Customize your toolbar and add the 'Research Assistant' icon. Click on it and it will open a window that, as you type or select items, will contextually give you information of what you're doing, including links to the built in documentation for that topic.
2) Enable code auto completion in the preferences for XCode.