fatal error: Index out of range

前端 未结 4 2098
长发绾君心
长发绾君心 2021-02-07 11:33

I want to show 25 of the songs I have in my library. This is my code:

var allSongsArray: [MPMediaItem] = []
let songsQuery = MPMediaQuery.songsQuery()

func numb         


        
4条回答
  •  野的像风
    2021-02-07 11:42

    You should return allSongsArray.count and to avoid being returned empty cells use yourTableView.reloadData after you fill your allSongsArray.

提交回复
热议问题