如何判断Documents下的指定目录是否存在? 如何判断Documents下的指定目录是否存在?FileManager中的 FileExistAtPath 返回的结果始终是-1我查了一下也没找到对Dir的相关接口 特在此请教,望解答. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *realPath = [documentPath stringByAppendingPathComponent:@"你的文件名"]; NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath:realPath]) {NSLog(@"存在这个文件");} 都放在沙箱的document目录中,放文件吧,别目录折腾了。 fileExistsAtPath:isDirectory:Returns a Boolean value that indicates whether a file or directory exists at a specified path.- (BOOL)fileExistsAtPath:(NSString *)path isDirectory:(BOOL *)isDirectory文档里有 cocos2d-x里面的getContentSize这个函数到底什么意思啊 Xcode 5.0 中如何添加异常断点? 跪求XCODE开发上农历转公历的算法,以及计算两个农历日相差天数的算法 UINavigationController旋转的问题 uitableview下拉刷新 uitextfield 不显示leftview iphone开发,对MAC系统版本是否有要求 动态生成二维数组 做个Ipad的杂志,需要了解哪些需求? 关于IOS APP推送 新手 sqlite3 存储图片的问题 iphone如何与其他第三方设备通过蓝牙进行通讯
NSString *realPath = [documentPath stringByAppendingPathComponent:@"你的文件名"];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:realPath])
{NSLog(@"存在这个文件");}