1.TableView 是由大量的Cell 构成的,包括Static Cells 和Dynamic Prototypes
static cell 通常用来设计固定的行数,通俗的讲就是写死的cell
Dynamic Prototypes 是用一个cell模板,可以用DataSouce 动态生成数据。
2.最好的方法就是用Storybord 来生成UItableView
viewController之间的传值。
Listing 3-1 Passing data to a destination view controller
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"ShowDetails"]) {MyDetailViewController *detailViewController = [segue destinationViewController];
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
detailViewController.data = [self.dataController
objectInListAtIndex:indexPath.row];
}}