我已經在我的iPhone應用程序中加載了一個簡單的UIWebView,該應用程序加載了一些嵌入了SGV的XHTML文檔。這一切都可以在桌面版本的Safari上找到,但它在UIWebView中崩潰。爲什麼UIWebKit會拋出一個structuralComplexityContribution異常?
這裏是客觀C:
NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"];
NSData *fileData = [NSData dataWithContentsOfFile: path];
[svgView loadData: fileData MIMEType: @"text/xml" textEncodingName: @"UTF-8" baseURL: [NSURL fileURLWithPath: path]];
我也嘗試了MIME類型是application/xhtml + XML的,但它並沒有幫助。
下面是HTML:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XTech SVG Demo</title>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg">
<g style="fill-opacity:0.7;">
<circle cx="6.5cm" cy="2cm" r="100" style="fill:red; stroke:black; stroke-width:0.1cm" transform="translate(0,50)" />
<circle cx="6.5cm" cy="2cm" r="100" style="fill:blue; stroke:black; stroke-width:0.1cm" transform="translate(70,150)" />
<circle cx="6.5cm" cy="2cm" r="100" style="fill:green; stroke:black; stroke-width:0.1cm" transform="translate(-70,150)"/>
</g>
</svg>
</body>
</html>
一切都非常基本的東西。在加載時在iPhone上,但是,它崩潰,此錯誤:
2010-03-31 10:37:10.252 ColorDoodle [2014:20B] - [一個DOMElement structuralComplexityContribution]:無法識別的選擇發送到實例0x3e51b60 2010 -03-31 10:37:10.253 ColorDoodle [2014:20B]終止應用程序由於未捕獲的異常 'NSInvalidArgumentException',原因是: ' - [一個DOMElement structuralComplexityContribution]:無法識別的選擇發送到實例0x3e51b60'
任何想法,爲什麼?這是UIWebView的渲染引擎中的錯誤嗎?我在這裏沒有看到任何奇怪的事情。
*更新*
肯定是有一些扭曲會在這裏。
如果我添加的這段代碼只是在標籤內,它工作正常:
<form>
</form>
採取這一代碼回來了,它再次崩潰。
扔一個.... ??這是什麼ad-libs :) – 2010-03-31 16:38:07
對不起。我在寫這個問題時被打斷了。我一定忘記回去完成這個主題! – Axeva 2010-03-31 19:56:46