2

I want to copy the music files of iphone ipod library using MPMediaPicker. Actually using MPMediaPicker I am able to get the path of ipod music library but when I convert music file at url in NSData, the result is null. I doubt that is it possible to get the music file from ipod library. I am not sure as there is no exception or warning while I am trying to convert url item in NSData using [NSData datawithContentOfUrl:ipod-library-path].

If someone has any idea about this or any alternative to copy music files.

Joel Mueller
  • 28,324
  • 9
  • 63
  • 88
Abhinav
  • 191
  • 8

1 Answers1

1

Your are getting Asset URLof music files.So it need to be converted into NSData to write into iphone library.

Refer Get video NSData from ALAsset url iOS link.

Now write data into iphone library.

Community
  • 1
  • 1
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
  • Actually I made a quick response.Have you ever tried this code on music library.That worked perfectly for UIImagePicker but when using this ipod music library I got an error mentioning Error: Global denied access.I was getting the selected song URL as oneipod-library://item/item.wav?id=2720595644450418781 but converting this url in NSData gave Error: Global denied access.That was my question that do we have access to music library? – Abhinav Nov 17 '12 at 04:56