检查软件包中是否存在文件 [英] Checking the presence of a file in the bundle

查看:137
本文介绍了检查软件包中是否存在文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在提取之前检查应用程序中加载的外部软件包中是否存在文件?

How can we check if a file is present in the external bundle loaded in the app or not before fetching it?

推荐答案

如果你只想知道它是否存在,所以你可以决定是否加载它,我只是试图加载它,并检查返回的对象是否为nil。如果是,您知道它不存在于包中。

If you only want to know if it's there so you can decide whether to load it or not, I'd just attempt to load it and check if the object returned is nil. If it is, you know it doesnt exist in the bundle.

这篇关于检查软件包中是否存在文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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