MPMediaQuery to return local items only

前端 未结 2 512
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 02:18

I want to display a UITableView with only the songs that are currently on the device.

If I query all items I (obviously) get all items, including the once that I purchas

2条回答
  •  遥遥无期
    2021-02-09 02:49

    I solved it myself by adding the following line in the viewDidLoad method between MPMediaQuery... and NSArray...

    [everything addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithBool:NO] forProperty:MPMediaItemPropertyIsCloudItem]];
    

提交回复
热议问题