First of all Im going to show you the error I am getting, then I will try to explain what I am doing to get this error etc
2011-11-02 10:17:57.665 code[1327:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: section (0) beyond bounds (0).'
*** First throw call stack:
(0x31fe88bf 0x31d581e5 0x31fe87b9 0x31fe87db 0x32b6df1f 0x29c9b 0x32ae26b5 0x32b3daf1 0x32afed21 0x32afea71 0x32afe78b 0x32afe4ff 0x32ab581b 0x32abafb9 0x3193aba7 0x3273be8d 0x31fbb2dd 0x31f3e4dd 0x31f3e3a5 0x3204afed 0x32ace743 0x35a1 0x301c)
terminate called throwing an exception(gdb)
This is what I am doing to get this error.
Any time that I enter the subview with the dataset of indexpath[0,1] for the second time the app will throw this error.
This is the code where the error happen. subview.m
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//Center previously selected cell to center of the screen
[self.tableView reloadData];
[self.tableView scrollToRowAtIndexPath:oldCheckedIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO]; //happens on this line
}
and this is the output from that error.
What should I be looking at.. I dont really know whats good or bad from this. Whats really frustrating is that if I go in and out of IndexPath [0,0] from the main view or any of the other ones it works fine and there is never a problem with this app..
I am hoping someone can help me, or at the very least give me an idea of what the problem might be or where.