0

I'm trying to save mp3 ringtone files using iTunes FileSharing but it doesn't work. All mp3 files are stored under supporting files.

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]);

Any help would be highly appreciated

moDev
  • 5,248
  • 4
  • 33
  • 63

1 Answers1

0

Finally!! I've solved it. I was doing silly mistake in copying file.

[fileManager copyItemAtPath:filePath toPath: m4rPath error:&err];
moDev
  • 5,248
  • 4
  • 33
  • 63