2012-07-25 36 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視圖中打開。

它也照顧你提到的錯誤。 (但只有忽略它..)

相關問題