Today, I met a line of code to open a webpage, which is much easier to implement than the uiwebview control in my impression. It is easy to use and can be easily used after real machine testing, I searched for some related information on the Internet:
Code segment: [[uiapplication sharedapplication] Openurl: url];
The system URL includes:
1. Map http://maps.google.com/maps? Q = Shanghai
2. email mailto: // myname@google.com
3. Tel: // 10086
4. msg sms: // 10086
-(Ibaction) openmaps {// open the map nsstring * addresstext = @ "Beijing"; // @ "1 infinite loop, Cupertino, CA 95014"; addresstext = [addresstext failed: nsasciistringencoding]; nsstring * urltext = [nsstring stringwithformat: @ "http://maps.google.com/maps? Q = % @ ", addresstext]; nslog (@" urltext =====================%@ ", urltext ); [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: urltext];}-(ibaction) openemail {// open mail // fire off an email to Apple support [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "mailto: // devprograms@apple.com"];} -(ibaction) openphone {// call Google 411 [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "Tel: // 10086"];} -(ibaction) opensms {// open the text message // text togoogle SMS [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "SMS: // 10086"];} -(ibaction) openbrowser {// open the browser // lanuch any iPhone developers fav site [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "http://blog.csdn.net/duxinfeng2010"];}
Reference http://www.cocoachina.com/bbs/read.php? Tid = 73570 & page = 3