I UITableView internet get data off. Sometimes it does not get any (cell) data, it only shows an empty table.
How can I show has found a message / cell users that no data record?
reporting on the lack of a cell data.
If you are keeping your sales data in an array that is a class property (assuming you want to go back NSArray * Listing ), you can go to:
- (NSInteger) tableView: (UITableView *) table numberOfRowsInSection: (NSInteger) section {if ([self.listings count] == 0) {return 1; // a single cell for a data report} return [self.listings count]; } - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {if ([self.listings count] == 0) {UITableViewCell * cell = [[[UITableViewCell alloc] init] autorelease]; Cell.textLabel.text = @ "No record to display"; // Configuring one of your cells, whatever you are returning to return cell; } // To know about your business, you need to display}}
Comments
Post a Comment