问题与UITableView:行动只能每隔一次

我有一个与UITableViewController的问题:表视图显示,但didDeselectRowAt将仅在触摸一个单元格时每隔一秒被调用。 有没有人看到这个代码的问题?

import UIKit import MediaPlayer class LibraryTableViewController: UITableViewController{ let mediaItems = MPMediaQuery.songs().items override func viewDidLoad() { super.viewDidLoad() self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return mediaItems!.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) cell.textLabel?.text = mediaItems?[indexPath.row].title return cell } override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { print("table item selected") OperationQueue.main.addOperation{ self.performSegue(withIdentifier: "showPlayer", sender: self) } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showPlayer"{ let playerVC = segue.destination as! PlayerViewController let indexPath = tableView.indexPathForSelectedRow! playerVC.mediaItem = mediaItems?[indexPath.row] } } } 

更改做了select selectRowAt to didSelectRowAt