如何检查MPMusicPlayerController权限?

时间:2017-07-05 19:57:03

标签: ios objective-c iphone mpmusicplayercontroller

我的目标c应用程序中有一个viewController来显示我的iPhone歌曲列表。我第一次打开这个viewController时,显示使用音乐的权限,但是当我接受权限时,所有歌曲的tableView都不刷新。 像这样: enter image description here

如何检查用户何时单击“允许刷新视图?”

1 个答案:

答案 0 :(得分:0)

MPMediaLibraryAuthorizationStatus authorizationStatus = MPMediaLibrary.authorizationStatus;

switch (authorizationStatus)
{
    case MPMediaLibraryAuthorizationStatusAuthorized:
    {
        break;
    }
    case MPMediaLibraryAuthorizationStatusNotDetermined:
    {

        break;
    }

    case MPMediaLibraryAuthorizationStatusRestricted:
    case MPMediaLibraryAuthorizationStatusDenied:
    {
        break;
    }
}