createDirectoryAtPath:attributes:alternative [英] createDirectoryAtPath:attributes: alternative

查看:196
本文介绍了createDirectoryAtPath:attributes:alternative的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[NSFileManager createDirectoryAtPath:attributes:]给了我一个贬值的警告。

[NSFileManager createDirectoryAtPath:attributes:] gives me a warning that it is depreciated.

有什么可选择的?还是有更好的方法呢?

What is the alternative? Or is there a better way of doing this?

谢谢

Tom

推荐答案

使用 createDirectoryAtPath:withIntermediateDirectories:attributes:error:

PS


createIntermediates 如果是,则
方法还将创建任何必需的
中间目录;如果否,则
如果要创建的
目录的任何父项不存在
,则该方法将失败。另外,如果你通过
这个参数的NO,目录在这次调用时不能存在

createIntermediates If YES, then the method will also create any necessary intermediate directories; if NO, then the method fails if any parent of the directory to be created does not exist. In addition, if you pass NO for this parameter, the directory must not exist at the time this call is made.

这篇关于createDirectoryAtPath:attributes:alternative的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆