Skip to content

Instantly share code, notes, and snippets.

@tobyjoe
Created July 4, 2009 18:38
Show Gist options
  • Save tobyjoe/140658 to your computer and use it in GitHub Desktop.
Save tobyjoe/140658 to your computer and use it in GitHub Desktop.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
NSUInteger count = [[fetchedResultsController sections] count];
if (count == 0) {
count = 1;
}
return count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSArray *sections = [fetchedResultsController sections];
NSUInteger count = 0;
if ([sections count]) {
id <NSFetchedResultsSectionInfo> sectionInfo = [sections objectAtIndex:section];
count = [sectionInfo numberOfObjects];
}
return count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment