请问这个路径该如何写? assert([[NSFileManager defaultManager] fileExistsAtPath:@“abc.zip"]);这里退出了,但是在这个应用程序的Document目录里面有这个文件,这个路径应该如何写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 NSString *documentsDirectory= [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];或者NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; 拿到Documents的目录,然后NSString *filePath= [documentsDirectory stringByAppendingPathComponent:@"abc.zip"]; 谢谢,那如果这样写,assert([[NSFileManager defaultManager] fileExistsAtPath:@“abc.zip"]);那么,这个文件应该放在哪里呢?也就是缺省的路径是什么? mountain lion下的xcode 4.4有问题 如何将char类型数组转化为unicode字符串 求助大家 如何让应用在后台运行? 有谁会给AppRTCDemo添加登录功能 ipad 升级到ios8 GameCenter 没有沙盒模式, 怎么破 苹果手机获取不到mac地址,imsi以及imei? ios开发时页面传值得问题,userId可以获得了,但是没法进行下面的步骤了 uitableview ios的fopen,fwrite,fclose三个函数太慢 微信支付 报错 not same appid with appid of access_token cocos2d js音效的问题
或者
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
拿到Documents的目录,然后
NSString *filePath= [documentsDirectory stringByAppendingPathComponent:@"abc.zip"];