The app in question has an ability for users to mark items as favourite. When the user has no favourites saved, I'd like to notify them of the fact (mostly I hate the idea of a blank tableView).
My numberOfRowsInSection is zero when there are no items the user has marked as favourite. I'd like to set cell.textLabel.text = @"You have no favourites" but when there are no items for the table cellForRowAtIndexPath is not called.
I could test numberOfRowsInSection to give a result when it encounters a 0 and then test for 1 row in cellForRowAtIndexPath and then insert the custom text but then what if they only have one favourite?
UPDATE
I tried implementing the idea I had above, and recommended below, but perhaps I'm not doing it right, probably due to the fact that it's a fetchedResultsController with the delegate methods to update the table when a change occurs.
I get this error when I delete the cell when there is but one cell in the table:
*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1447.6.4/UITableView.m:976
Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted). with userInfo (null)
and when there are no cells to be displayed in the first place it crashes with:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[_PFBatchFaultingArray objectAtIndex:]: index (0) beyond bounds (0)'
Here is the relevant code:
- (NSInteger)ta