Reputation: 1350
I try to make UIViewController
(VC) with UITableView
(TV) inside it with custom prototyped cells
(PC). I use mainly Interface Builder. I do follwing steps:
I created VC
and I add TV
to it in the Storyboard
.
I set VC
class as delegate to the TV
using UITableViewDelegate
.
I created PC
and created custom class for it. I set that class to be custom class for PC
I added TV
as outlet to VC
class code.
I added all controls from PC
as outlets to PC
custom class.
I configured identifier for PC
. I added all methods of TV
to VC
class.
When I run my App the methods for TV
never start and the TV
is empty. I am sure that I missed something but I can not figure what. Any ideas?
Upvotes: 1
Views: 74
Reputation: 3003
You need to implement methods of UITableViewDataSource as well as UITableViewDelegate.
-(NSInteger)numberOfSectionInTableView:(UITableView *)tableView;
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)secion;
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath)indexPath;
Upvotes: 1