我已经在我的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