目录性能优化
点击storyboard下面的小按钮添加AutoLayout约束,调整顶部margin为20(这个距离刚好不被statusBar挡住)。性能
注意:若是使用代码添加tableView就须要在代码中添加约束优化
让ViewController遵照UITableViewDataSource协议 须要在didload方法中发送tableView setDataSource = self。ui
注意:能够在storyboard中设置TableView的outlet:datasource代理
也可让ViewController遵照代理协议UITableViewDelegate协议
在didload方法中设置tableView的代理。code
**注意:能够在storyboard中设置TableView的outlet:delegateget
@required - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; // Row display. Implementers should *always* try to reuse cells by setting each cell\'s reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier: // Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;