2012-07-25 37 views
0

我试图让iTunes从装载在UIWebView中的html页面启动。是否可以从UIWebView中的页面启动iTunes?

使用来自苹果的文档

http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/iTunesLinks.html#//apple_ref/doc/uid/TP40007896-SW1

<a 
href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=156093464&id=156093462&s=143441"> 
<img height="15" width="61" alt="Randy Newman - Toy Story 
- You&#39;ve Got a Friend In Me" src="http://ax.phobos.apple.com.edgesuite.net/images/ 
badgeitunes61x15dark.gif"></img> </a> 

当我点击按钮didFailLoadWithError的例子:将调用与WebKitErrorDomain 101

shouldStartLoadWithRequest:;是对任何请求)

在浏览器中加载相同的HTML页面的作品。


(有与该代码实际上另外一个问题,看到这个链接 Remote image doesn't get displayed in html page displayed in UIWebView

但将其更改为在此之后仍不能在UIWebView的工作,但确实在浏览器中

<a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=156093464&id=156093462&s=143441"> 
     <img height="15" width="61" src="Btn_Go.png""></img> 
    </a> 
+1

哦,上帝,我花了太长时间笑着'shouldShartLoadWithRequest:'。 – 2012-07-25 22:04:28

+0

无论如何,你可以发布你的按钮的代码? – 2012-07-25 22:05:05

回答

0

你会在this question找到你要找的东西

答案用-webView:shouldStartLoadWithRequest:navigationType和url点击链接的方案以确定链接是否应该由系统或在web视图中打开。

它也照顾你提到的错误。 (但只有忽略它..)

相关问题