gpt4 book ai didi

swift - NSTemporaryDirectory() 没有空格

转载 作者:行者123 更新时间:2023-11-28 06:09:59 26 4
gpt4 key购买 nike

guard let tempDirURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("MyAppStuff.xxx") else {
return nil
}

我的问题是:tempDirURL.path 中间总是没有空格吗?

编辑,来自文档:enter image description here

最佳答案

API 契约不保证 NSTemporaryDirectory() 返回的路径不包含空格;因此你不能假设它不会。您需要考虑路径可能包含文件系统允许的任何和所有字符的可能性。

关于swift - NSTemporaryDirectory() 没有空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47021501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com