我目前正在尝试将一个库集成到我的ios应用程序中。图书馆里有这样的东西
// Serve files from the standard Sites folder
NSString *docRoot = [[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"web"] stringByDeletingLastPathComponent];现在,我相信这将定位目录web中的index.html。我确实有一个带有index.html的网页文件夹。但是,我不知道ios应用程序在哪里查找文件夹web。有什么建议吗?
发布于 2015-04-21 02:26:08
检查目录是否可读
参考:
+ (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension inDirectory:(NSString *)bundlePath返回值资源文件的完整路径名,如果无法找到该文件,则为零。如果bundlePath参数指定的包不存在或不是可读目录,则此方法还返回零。
https://stackoverflow.com/questions/29761365
复制相似问题