访问iPhone数据之前的用户权限 [英] User permission before accessing iPhone data

查看:90
本文介绍了访问iPhone数据之前的用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
获得访问相机胶卷"的权限

我正在xcode 4.3.2中创建与iOS5兼容的应用程序.当我访问照片时,当我在iOS 6.0设备中运行此应用程序时,它也不显示权限警报.谁能帮我如何显示iOS6设备的权限警报.预先感谢.

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.

推荐答案

您可以借助 ALAssetsLibrary 库& ALAuthorizationStatus

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];
    }

这篇关于访问iPhone数据之前的用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆