需要有关ALAssetsLibraryAccessGloballyDeniedError的帮助

时间:2014-04-22 07:05:23

标签: ios objective-c alassetslibrary

  

ALAssetsLibrary Class Reference

     

特殊注意事项:此方法将失败并出现错误   如果用户尚未启用,则为ALAssetsLibraryAccessGloballyDeniedError   位置服务(在设置>常规中)。

  1. 设置>中的位置服务在哪里?将军?
  2. 我在设置>中重置了位置和隐私以及停用的位置服务。隐私>位置服务,这是我仍然给我ALAssetsLibraryAccessGloballyDeniedError错误的代码。
  3. `

    -(void)requestAccessForAssetsLibrary {
        ALAssetsLibrary *aLib = [[ALAssetsLibrary alloc]init];
        void(^assetsGroupEnumerationBlock)(ALAssetsGroup*, BOOL*) = ^(ALAssetsGroup *groups, BOOL *stop) {
            *stop = YES;
            NSDictionary *alAuthDict = @{@"alAssetsAuthStatusDictKey" : [NSString stringWithFormat:@"%d",[self getALAssetAuthorizationStatus]]};
            [[NSNotificationCenter defaultCenter]postNotificationName:@"alAssetsStatusNotificationName" object:nil userInfo:alAuthDict];
        };
        void(^failureBLock)(NSError*) = ^(NSError *error) {
            NSDictionary *alAuthDict = @{@"alAssetsAuthStatusDictKey" : [NSString stringWithFormat:@"%d",[self getALAssetAuthorizationStatus]]};
            [[NSNotificationCenter defaultCenter]postNotificationName:@"alAssetsStatusNotificationName" object:nil userInfo:alAuthDict];
        };
        [aLib enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:assetsGroupEnumerationBlock failureBlock:failureBLock];
    }
    

    `

0 个答案:

没有答案