NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];

NSString *realPath =[documentPath stringByAppendingPathComponent:filename];

用这个方法后file在电脑中的路径为:当前用户/Library/Application Support/iPhone Simulator/版本号(4.1)/Applications/你的app名所在文件夹/Documents

通过这个路径可以找到你项目的所存的数据库,以及各种缓存等文件.

 posted on 2010-11-18 18:09  Sure-G  阅读(396)  评论(0编辑  收藏  举报