In iPhone, how to store audio file picked from media picker to some directory?
How can I write an audio file picked from mediaPicker
into some particular folder? We are currently writing image to file path with this method:
[UIImagePNGRepresentation(im开发者_C百科age) writeToFile:pngPath atomically:YES];
Is it possible for to do the same kind of thing with an audio file?
Thanks.
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag
is a method of the NSData
class, so, once you have fetched your audio from the media picker, you should totally be able to write it to a file that way.
Note: You might have to convert the audio picked to NSData first
Cheers
精彩评论