I've spent literally weeks trying to get sections and rows to work in my table and have finally did it!
Next I noticed that even though I had plenty of data to view, I could not scroll down past what is first displayed on screen. Additionally, the scroll bar seems to be fatter than usual and there is a number 2 displayed in the upper right hand corner.

Not sure what I'm doing wrong. Can someone lead me nudge me in the right direction?
I couldn't capture the fat scroll bar, but it is definitely wider than it should be.

EDIT1: Changing @"addDate" of the sectionNameKeyPath of the fetchedResultsController, results in the removing of the dates and sections, leaving one section and the scroll works fine. Leaving the @"addDate" does what I want with sections, but I don't understand why it doesn't scroll with that 2 and a "fat" scroll.

EDIT2: I found my problem... I had borrowed code from another instructional course to get my CoreDataTableViewController working and it had implemented sectionIndexTitlesForTableView. Commented out and is working!

2 Answers
2

It's difficult not seeing your code or understanding what the data is. But I can help a little.

That 2 in the corner is your table view's section index column (that also might be what you mean by fat scroll bar). You've got 2 sections both starting with the number 2. If the section titles were words, you'd see an alphabetical index.

The fact that the index is only showing 1 value though may mean that your table view does not show the complete data set that you're expecting, only the 2 sections you have on the screen.

Perhaps show some code? Even just the setup code might be helpful. Typically the CoreDataTableViewController needs an NSFetchedResultsController, a title key and so on. Showing some of that code might provide more clues.

Still unsure but I noticed a couple of things:
–
Andrew TetlawJul 23 '12 at 1:11

You use fetchRequestWithEntityName:entityName to get the fetch request, but then also set the entity property. Not sure what the effect will be, but setting the entity property seems redundant. Also you set the fetched results controller delegate to nil, is that intentional? Try logging the result from your - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView method call, and - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section call.
–
Andrew TetlawJul 23 '12 at 1:28

Well, in regards to setting the entity property twice. That was leftover from me trying all sorts of things. I've removed and didn't fix problem. Setting the controller delegate to nil was read somewhere, where I needed to show only the date once, but there are multiple records of same date. Again, leftover, removed and same problem. I do have NSLog's on the those methods, displaying the returned values as expected.
–
BlizzofOZJul 23 '12 at 16:52

Adding to my comment above: I know noticed that the NSLog in titleForHeaderInSection is displaying twice, for each section. Removing that method doesn't fix problem, yet the date, which is the section name, still appears. I'm confused
–
BlizzofOZJul 23 '12 at 16:53

I found my problem... I had borrowed code from another instructional course to get my CoreDataTableViewController working and it had implemented sectionIndexTitlesForTableView. Did some massive searching and found this brought up somewhere. Commented out the sectionIndexTitlesForTableView method and it is working perfectly!