///沙盒路徑 + (NSString *)pathDocument{ NSFileManager *fileManager = [[NSFileManager alloc]init]; NSString *pathDocuments = [NSSearchPathForDirectoriesInD... ...
///沙盒路徑 + (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; }