在iPhone應(yīng)用中有可能會(huì)遇到想鏈接到app store軟件產(chǎn)品或者評(píng)論頁(yè)面等鏈接,直接在app程序中就可以鏈接到相應(yīng)頁(yè)面里。使用UIApplication類(lèi)的OpenURL方法。
代碼如下:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"程序的相應(yīng)連接"]];
實(shí)例代碼:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=abc"]];
或者
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=40461254"]];