我正在 iPhone 5s 上测试我的应用程序,在此应用程序中我使用 NSData.writeToURL(destinationUrl, atomically: true)
保存音频文件, 但这条线不起作用。
destinationUrl 是如何生成的:
let documentsUrl = NSURL(fileURLWithPath: NSBundle.mainBundle().resourcePath!)
let fileName = remoteFileUrl.lastPathComponent
let destinationUrl = documentsUrl.URLByAppendingPathComponent(fileName)
在 iOS 模拟器中测试时 - 一切正常
我该如何解决?
最佳答案
您不得在运行时向应用程序包中写入任何内容。
这将破坏应用程序的代码签名。
关于ios - NSData.writeToURL 不适用于 iPhone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32318658/