I currently have a uitableview in place.
The data is obtained from an sqlite file.
Each column of the sqlite file will represent a list of: labels, images etc
The code i am using to get rows is
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
AppDelegate* appdelegate = (AppDelegate*) [[UIApplication sharedApplication]delegate];
return [appdelegate.arrayDatabase count];
}
The code to populate the cells
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"simpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == Nil)
{
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
}
AppDelegate * appdelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
ShowsList *sShows = [appdelegate.arrayDatabase objectAtIndex:indexPath.row];
cell.textLabel.text = [sShows strName ];
}
The problem i am having:
I want to use the labels column to populate the cell text of ViewController1.tableview but it is returning the null rows and displaying empty rows/cells in the view.
However I want to hide the rows by either counting the null cells and applying the count to the numberOfRowsInSection: method or by simply hiding empty cells.
Hide empty cells in UITableView & How to hide a section in UITableView? looks like something similar but didn't resolve my issue.
Could somebody please point me down the correct path or provide the answer :)
Thanks so much
Thomas