///沙盒路径+ (NSString *)pathDocument{ NSFileManager *fileManager = [[NSFileManager alloc]init]; NSString *pathDocuments = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0]; NSString *voiceDirectory = [pathDocuments stringByAppendingPathComponent:@"文件夹名"]; ///判断是否有该文件夹 if (![fileManager fileExistsAtPath:voiceDirectory]) { ///如果没有就新建该文件夹 NSError *error = nil; [fileManager createDirectoryAtPath:voiceDirectory withIntermediateDirectories:YES attributes:nil error:&error]; if (!error) { return nil; } } return voiceDirectory;}