【发布时间】:2016-12-05 19:00:26
【问题描述】:
我正在使用 SceneKit 和 Collada 文件。现在,我可以在 art.scnassets 文件夹以及我的项目根目录中加载 collada 文件。当我尝试从本地网络服务器加载文件时出现错误。为什么我不能这样做?
let url = NSURL(string: "http://localhost:8888/new.dae")
let scn = try! SCNScene(URL: url!, options: nil)
2016-07-31 17:41:29.537 biOS[3863:254446] SceneKit IO: error, COLLADA files are not supported on this platform.
fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=259 "The document "new.dae" could not be opened." UserInfo={NSURL=http://localhost:8888/new.dae, NSLocalizedDescription=The document "new.dae" could not be opened., NSLocalizedRecoverySuggestion=Collada is not supported by this version of SceneKit}: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-703.0.18.8/src/swift/stdlib/public/core/ErrorType.swift, line 54
我的目标是从网络服务器读取 collada 文件,然后让用户将文件下载到设备上。我不知道为什么我收到错误。顺便说一句,我做了一个文档预览来渲染文件,它即将成功地以 xml 渲染文档。因此,这不是访问文件的情况。请帮忙!
【问题讨论】:
标签: ios swift scenekit collada