To access MLMediaLibrary your application must be isolated and encoded.
Update
It looks like you also need to add some read-only permissions to your .entitlements file.
If you want to access photos, iPhoto or Aperture libraries:
<key>com.apple.security.assets.pictures.read-only</key> <true/>
If you want to access iMovie and FinalCut:
<key>com.apple.security.assets.movies.read-only</key> <true/>
If you want to access iTunes or logic:
<key>com.apple.security.assets.music.read-only</key> <true/>
Here you can read about my poor experience in the MediaLibrary environment: https://devforums.apple.com/message/1125821
source share