8

OK, so I have had this problem before and solved it unknowingly and now it is reoccurring!

"error: 
 Error Domain=ALAssetsLibraryErrorDomain Code=-3312 "Global denied access" UserInfo=0x169aa0 
 {NSLocalizedFailureReason=The user has denied all applications access to their media., 
 NSLocalizedRecoverySuggestion=This setting can be changed in Preferences., 
 NSLocalizedDescription=Global denied access}"

Please NOTE://I do not get this issue in the simulator - my code for iterating assets works perfectly on the simulator.

Surely this is an easy fix but be damned if I can find anything under 'Preferences' anywhere that assists.

Please halp!

Lance
  • 1,161
  • 3
  • 12
  • 26

3 Answers3

15

What a joke - Location services must be turned on...

What a JOKE!

Lance
  • 1,161
  • 3
  • 12
  • 26
10

Simply go to Settings>General>Reset>Reset Location Warnings.

However this won't help your users out but it is useful for development

Anthony McCormick
  • 2,724
  • 3
  • 25
  • 27
  • I added a post here about how to detect and alert your users their location settings are turned off for your application. http://www.betadesigns.co.uk/Blog/2010/12/10/error-clclientinvalidate-could-not-send-unregistration-request-to-daemon/ – Anthony McCormick Dec 11 '10 at 17:39
  • In iOS 7 this error occurred in simulator too and I managed to do by this way. – Imran Jun 13 '14 at 05:27
3

For iOS 4.2 and later use CLLocationManager authorizationStatus class method.

it will return a CLAuthorizationStatus enum ( declared at CLLocationManager.h ), you can test the return for kCLAuthorizationStatusAuthorized.

if ( [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized ) {
    // do your stuff
} else {
   // sorry user, you must enable us to see your location if you want to use YOURS assets library
}

iOS 6 introduce this method for ALAssetsLibrary class also.

Ricardo Rivaldo
  • 1,687
  • 2
  • 15
  • 13