Swift 2.0 : 'enumerate' is unavailable: call the 'enumerate()' method on the sequence

Swift 2.0 : 'enumerate' is unavailable: call the 'enumerate()' method on the sequence

 

如下代码:

      for (index,cell) in enumerate(self.tableView.visibleCells){
            if let acell = cell as? ChatCell {
               acell.changeColor(self.isWhiteBackground)
            }
        }

修改为如下:

      for (index,cell) in self.tableView.visibleCells.enumerate(){
            if let acell = cell as? ChatCell {
               acell.changeColor(self.isWhiteBackground)
            }
        }

http://stackoverflow.com/questions/30730387/swift-2-0-enumerate-is-unavailable-call-the-enumerate-method-on-the-seq

查找原因如下,

posted @ 2015-09-16 11:04  Qingyun_Qearl  阅读(858)  评论(0编辑  收藏  举报