我正在尝试使用 iTunes FileSharing 保存 mp3 铃声文件,但它不起作用。所有 mp3 文件都存储在支持文件下。
NSString *fileName = @"demo.mp3";
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *m4rPath = [documentsDirectory stringByAppendingPathComponent:fileName];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *err = nil;
[fileManager copyItemAtPath:filePath toPath:[m4rPath stringByAppendingPathComponent:fileName] error:&err];
NSLog(@"%@",[err localizedDescription]);
任何帮助将不胜感激