关键词:tableView header footer section Cell /Row
枚举类型
行高默认
行数
每一行数据
Cell、Header、Footer宽度一定与TableView相同
x/y/width无效(TableView中)
同一个Cell对象会重复使用,在队列中获取空闲的Cell
var cell = tableView.dequeueReusableCellWithIdentifier("cell")
4.几个关键函数:
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
didSelectRowAtIndexPath
viewForHeaderInSection
heightForHeaderInSection
5.建立一个类比建立数组或者字典要优越的多,可以在敲代码的时候弹出类中的成员变量
比如: var channel_id: String!
var channel_name: String!
- 在refreshTableView放入主线程中执行
方法一:
self.tableView.performSelectorOnMainThread(#selector(self.tableView.self.reloadData), withObject: nil, waitUntilDone: false)
方法二:
self.performSelectorOnMainThread(#selector(self.refreshTableView), withObject: nil, waitUntilDone: true)
7.tableView.reloadData() //重新加载