1. Create a nib file Cell.xib
2. Drag a uitableview out of the nib, set its reuse Identifier, and then drag the view to the cell UI to place
3. Creating Viewcontroller and TableView
4. Create the TableView in Viewcontroller (iboutlet) TableView
5. Set TableView delegate and DataSource (if the runtime finds all table cells to be blank, it is likely that this step has been forgotten)
6.viewDidLoad Register nib file (TableView registernib:)
7. Let Viewcontroller follow TableView's <uitableviewdatasource, uitableviewdelegate> protocol
8. Implementing the Protocol Approach
-(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView;
-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath
which
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath
If you take advantage of Dequeuereusablecellwithidentifier:forindexpath, you do not need to determine if the cell is nil and then create it, because this method
A new object is created in the multiplexing queue without a file or class that can be automatically called for registration.
If you want to respond to clicking on a cell, you need to implement-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) Indexpath
How do I use TableView to display a UITableViewCell or subclass created in a custom nib?