获取iPhone mainBundle文件 [英] Getting iPhone mainBundle Files

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

问题描述

我不知道我需要检索我的iphone应用程序mainBundle中资源的所有文件名的确切代码。如果我可以有某种代码,如:

I dont know the exact code i need to retrieve all of the filenames of the resources in my iphone apps mainBundle. if i could have some kind of code like:


  NSArray *array = [[NSBundle mainBundle] getAllResourceFilenames];

这会有所帮助。感谢任何帮助!

it would be helpful. thanks inadvanced for any help!

推荐答案

您应该查看NSFileManager的SDK文档,但这将帮助您入门:

You should look at the SDK documentation for NSFileManager, but this will get you started:

NSString *path = [[NSBundle mainBundle] resourcePath];
NSFileManager *fm = [NSFileManager defaultManager];

NSError *error = nil;

NSArray *directoryAndFileNames = [fm contentsOfDirectoryAtPath:path error:&error];

这篇关于获取iPhone mainBundle文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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