sathya sathya - 1 year ago 73
Objective-C Question

Why table view not showing any data in iphone

When parsing a local XML file i can see the data in console using NSLog. While in the simulator am getting only the plain table view without any data parsed from xml. Am not understanding where am missing it.


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

theLists = [app.listArray objectAtIndex:indexPath.row];
cell.textLabel.text = theLists.title;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;

Answer Source

I got the answer finally where i didn't properly connected the tableview controller class with corresponding controller. I followed the link Trouble making connections with story board

And finally it showed the data in the table view. Hope this answer might help others. Thanks for all the people who gave their suggestions in this post.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download