【发布时间】:2017-07-23 07:04:47
【问题描述】:
我正在尝试制作一个音乐播放器,在一个视图中,我有一个 UITableView 的播放列表,我希望当用户点击一个单元格时,它会转到另一个包含歌曲列表的 UITableView在播放列表中。执行此操作时,我收到以下错误:
"2017-07-22 23:58:35.479139-0700 FoodTracker[740:118055] ; layer = ; contentOffset: {0, 0}; contentSize: {375, 1080}> 的 窗口不等于 's 视图的窗口!”
项目的名称是 foodTracker,因为我在 Apple 教程项目的基础上构建了一个测试项目。此外, playlistTable 是带有歌曲的表格视图。不是播放列表。有什么办法可以解决这个错误吗?
我的tableView()代码如下:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
NSLog("You selected cell number: \(indexPath.row)!")
tableView.deselectRow(at: indexPath, animated: true)
let thePlaylist = playlistArray[indexPath.row].songs
songsToShow = loadSongs(songs: thePlaylist)
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let destination = storyboard.instantiateViewController(withIdentifier: "playlistTable") as! playlistTable
destination.songArr = songsToShow
navigationController?.pushViewController(destination, animated: true)
performSegue(withIdentifier: "goTo", sender: self)
}
【问题讨论】:
-
这 2 个
UITableViews 是在相同的视图中还是不同的视图中?
标签: ios iphone swift uitableview uistoryboardsegue