Hi
I'd like to pass an NSInteger to a tableView controller and then use it to set a badge.
In this case, the NSInteger I'd like to pass is the number of rows in a tableView, returned with Core Data (numberOfRows).
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSInteger numberOfRows = 0;
if ([[fetchedResultsController sections] count] > 0) {
id NSFetchedResultsSectionInfo sectionInfo = [[fetchedResultsController sections] objectAtIndex:section];
numberOfRows = [sectionInfo numberOfObjects];
}
return numberOfRows;
}
How can I declare another NSInteger and then pass it to a tableView controller?
Thanks,
Matthew