I want to create UITableView with storyboard as the pic shows:
and the delegate methods in ITViewController.m is as below:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ITTableViewCell *cell = (ITTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"ITTableViewCell"];
return cell;
}
When I ran my app, I got the error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
It seems that no cell has been initialized, how can I fix this problem? thks!