2017-05-18 35 views
0

我在下面的第4行中得到錯誤,我嘗試重新載入表的一部分。我也嘗試使用NSMakeRange([indexPath.section], 1),但不斷收到相同的錯誤。上下文類型NSIndexSet不能與數組文字一起用於Swift 2.x

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 
     if (indexPath.section == 1) { 
      isSectionSelected = true 
      self.tableView.reloadSections([indexPath.section], withRowAnimation: .None) 
      self.performSegueWithIdentifier("serviceHistoryDetailView", sender: self) 
     } 
     tableView.deselectRowAtIndexPath(indexPath, animated: true) 
} 

回答

1

reloadSections期望一個NSIndexSet,而不是Int陣列。

您需要從indexPath.section創建NSIndexSet。然後通過那個NSIndexSet,而不是一個數組。

+0

就這麼簡單。謝謝! – Jace

相關問題