Looks like your BNRItemsViewController.m is missing the following (from page 170 of the book)
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
return [[[BNRItemStore sharedStore] allItems] count];
As for the process, I’m an aging developer but a noob with Objective-C and iOS. However, my understanding of the TableViewController is the following. When drawing a table the delegate is asked:
[ul]How many sections do I need - via numberOfSectionsInTableView:
How many rows in each section - via tableView: numberOfRowsInSection:
What data do I need in the cell - via tableView: cellForRowAtIndexPath: (called once for each row)[/ul]
The fact that the final method wasn’t called suggested the possibility that:
a) the wrong method had been implemented (which seems to be easily done in Xcode with so many methods with similar names)
b) the right method wasn’t being called (Captain Obvious, but bear with me here!)
I checked a) first in your code and it looked fine, so the question for b) then became
What could cause the method to not be called? You don’t have much control over the sequence of calls between iOS and your Table methods, so the next thing that came to mind was, maybe it is being called, but called zero times (if you follow me).
What could cause it to be called zero times? My next thought was that numberOfRowsInSection: contained an error that was causing nil (or zero) to be returned.
So, I dug into the code to see how that method had been implemented, and look for logic errors, typos etc. that might cause that. When I looked for the method, I couldn’t find it, so that would also explain a zero value.
Now, if you read this and point out you did, in fact, implement the method and I failed to see it, I will shuffle off quietly mumbling to myself about “too late in the evening, lack of caffeine ingestion” etc. etc.!! However, the debugging approach still holds true.