我正在尝试使用新的Photos Framework,但是当“允许访问照片”警报视图完成时,我似乎找不到找到通知的方法。有什么想法吗?

我尝试通过通知进行操作。

[[NSNotificationCenter defaultCenter] addObserverForName:UIWindowDidResignKeyNotification object:self queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
    //figure out the result of the request
    // This never gets called
}];

最佳答案

使用提供的API可以为您提供所需的确切信息。

+[PHPhotoLibrary requestAuthorization:(void (^)(PHAuthorizationStatus status))handler]

此方法总是立即返回。如果用户以前有
授予或拒绝照片库访问权限,它将执行
处理程序块在调用时;否则,它会显示警报并
仅在用户响应警报后才执行该块。

关于ios - 在系统UIAlertView关闭时通知,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25536751/

10-14 16:52
查看更多