override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
//添加置顶按钮
let topAction = UITableViewRowAction(style: .Default, title: "置顶") {
(action: UITableViewRowAction!, indexPath: NSIndexPath!) -> Void in
self.dataSource.exchangeObjectAtIndex(indexPath.row, withObjectAtIndex: 0)
var first:NSIndexPath = NSIndexPath(index: 0)
tableView.moveRowAtIndexPath(indexPath, toIndexPath: first)/***************崩在了这句****************/
}
}
return[topAction]
}
//添加置顶按钮
let topAction = UITableViewRowAction(style: .Default, title: "置顶") {
(action: UITableViewRowAction!, indexPath: NSIndexPath!) -> Void in
self.dataSource.exchangeObjectAtIndex(indexPath.row, withObjectAtIndex: 0)
var first:NSIndexPath = NSIndexPath(index: 0)
tableView.moveRowAtIndexPath(indexPath, toIndexPath: first)/***************崩在了这句****************/
}
}
return[topAction]
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货