我是新來的iPhone開發,我想加載一個HTML對象到UIWebView
。如何在UIWebView中加載HTML對象?
問題是,當我將HTML數據轉換爲字符串時,應用程序崩潰並且說EXC_BAD_ACCESS
。該對象是一個brightcove視頻,我直接從brightcove網站複製了嵌入代碼,所以我不明白它爲什麼不起作用。任何幫助是極大的讚賞。
代碼:
NSString *brightstring = [NSString stringWithFormat:@"<html><body><object id=flashObj width=540 height=400 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0><param name=movie value=http://c.brightcove.com/services/viewer/federated_f9?isVid=1 /><param name=bgcolor value=#FFFFFF /><param name=flashVars value=videoId=%@&playerID=659636031001&playerKey=AQ~~,AAAAC59qSJk~,vyxcsD3OtBM6WfpHEsDft5laXH9ASJhF&domain=embed&dynamicStreaming=true /><param name=base value=http://admin.brightcove.com /><param name=seamlesstabbing value=false /><param name=allowFullScreen value=true /><param name=swLiveConnect value=true /><param name=allowScriptAccess value=always /><embed src=http://c.brightcove.com/services/viewer/federated_f9?isVid=1 bgcolor=#FFFFFF flashVars=videoId=%@&playerID=659636031001&playerKey=AQ~~,AAAAC59qSJk~,vyxcsD3OtBM6WfpHEsDft5laXH9ASJhF&domain=embed&dynamicStreaming=true base=http://admin.brightcove.com name=flashObj width=540 height=400 seamlesstabbing=false type=application/x-shockwave-flash allowFullScreen=true swLiveConnect=true allowScriptAccess=always pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></embed></object></body></html>", clipid]; //<--Crashes Here
NSString* html = [NSString stringWithFormat:brightstring, 540, 400];
[videoScreen loadHTMLString:html baseURL:nil];
感謝您的回覆。我只是將第二個參數添加到我的brightstring的末尾,現在它不會崩潰,但它也不會加載。有什麼想法嗎? – 2013-03-09 01:43:23