我在使用重装数据刷新我的UITableView时遇到问题。ReloadData不刷新列表
作为一个快速描述: 这个类收到NSNotification包含对象与数据需要添加到列表和设备必须震动一次,表明数据收到。设备本身振动,但列表没有更新,所以没有新的数据添加到列表中。收到通知时
代码:
dispatch_async(dispatch_get_main_queue(), {
let object = notification.object as! Attendee
self.handshakesArray.append(object)
self.tableViewMain.reloadData()
AudioServicesPlayAlertSound(UInt32(kSystemSoundID_Vibrate))
})
我不知道这是一个iOS的问题,或者我的实现是错误的。
编辑:
class Shakes: UITableViewController {
private var handshakesArray = [Attendee]()
override func viewDidLoad() {
super.viewDidLoad()
}
func executeTask(notification:NSNotification) {
dispatch_async(dispatch_get_main_queue(), {
let object = notification.object as! Attendee
self.handshakesArray.append(object)
self.tableViewMain.reloadData()
AudioServicesPlayAlertSound(UInt32(kSystemSoundID_Vibrate))
})
}
// ........
}
在此先感谢
是我编辑我的问题 – Melchior