我有保存 mp3 文件的代码
NSArray *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDirectory = [documentPath objectAtIndex:0];
NSString *fileName = [[NSString alloc] initWithFormat:@"%@%@.mp3", dateString ,timeString ];
NSURL* fileURL = [NSURL URLWithString:myString];
NSError* error = nil;
NSData* data = [NSData dataWithContentsOfURL:fileURL options:0 error:&error];
NSString *savePath = [docDirectory stringByAppendingPathComponent:fileName];
[data writeToFile:savePath atomically:YES];
现在我想通过MPMoviePlayerController读取这个文件
如何获取路径或nsurl文件
--- somthing 代码与此相同
NSURL * urlv = [[NSURL alloc] initWithString:myString];
avPlayer = [[MPMoviePlayerController alloc] initWithContentURL:urlv];
[avPlayer prepareToPlay];
[avPlayer play];
请帮助搜索 mystrig 或 nsurl 源