User permission before accessing iPhone data [duplicate]

情到浓时终转凉″ 提交于 2019-12-11 18:30:51

问题


Possible Duplicate:
Ask permission to access Camera Roll

I am creating a app compatible with iOS5 in xcode 4.3.2. When i access photos, It is not showing permission alert also when i am running this app in iOS 6.0 devices. Can any one help me how to show permission alert for iOS6 devices. Thanks in advance.


回答1:


you can show this by help of ALAssetsLibrary library & ALAuthorizationStatus

ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];

    if (status != ALAuthorizationStatusAuthorized) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message" message:@"permission alert message" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil, nil];
        [alert show];
    }


来源:https://stackoverflow.com/questions/14394886/user-permission-before-accessing-iphone-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!