2017-01-20 278 views
0

坚持文件我已经得到了来自在我应用嵌入式一个文件(例如“file.ieee”)(在构建时包含在资产)。斯威夫特

该应用程序将从Web服务中获取新版本并将其存储在临时目录中(请参阅下面的代码)。

如何替换(并坚持)新版本?

// Construct the NSURL for the download location. 
    let downloadingFilePath = NSURL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("downloaded-file.ieee") 

我基本上要downloaded-file.ieee的内容在 “file.ieee” 复制。

+0

只是构建使用文件夹中的下载位置,那不是暂时的。顺便说一句,你应该阅读这个https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html –

回答