我无法将我的应用程序从 WatchOS 1 转换为 WatchOS2。我正在以编程方式在 iPhone 上创建一系列图像供 Watch 播放。
我将它们放在 iOS 中的一个 zip 文件中(使用 SSZipArchive),并transferFile()
用于将其发送到手表,我在 Watch Extension 委托中将其解压缩到 Watch Extension 和 Watch App 之间的共享容器,Watch App 可以稍后播放序列:
func session(session: WCSession, didReceiveFile file: WCSessionFile)
{
imagesURL = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier("group.com.xxxx.images")
SSZipArchive.unzipFileAtPath(file.fileURL.path, toDestination:imagesURL!.path)
}
我检查了共享组设置是否正确,并且可以在共享目录(imagesURL!.path)中看到图像文件。
但是当我准备好播放序列时:
image.setImageNamed("myImages") // myImages0.png, myImages1.png, myImages2.png, etc.
我收到错误:无法在手表上找到名为“myImages”的图像
- 我将图像放在正确的位置吗?
- 我在 setImageNamed 中正确地引用了它们吗?
- 我还缺少其他东西吗?