<span style="font-size:18px;"> NSArray *searchPach = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path1 = [[searchPach firstObject] stringByAppendingPathComponent:@"file1"];</span>
NSFileManager *manager = [NSFileManager defaultManager]; NSURL *url = [[manager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] firstObject]; NSURL *path2 = [url URLByAppendingPathComponent:@"MyDocument"]; UIManagedDocument *managedDocument = [[UIManagedDocument alloc]initWithFileURL:path2];
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/text.txt”];
原文地址:http://blog.csdn.net/sinat_19587549/article/details/41924693