Hi all,
I've got a view containing a segmentedControl and a tableView. The tableView is populated depending on the segmentedControl item that is selected (in this case Food and wine). The data for the tableView is generated from coreData.
It works fine when starting up the application which any of the segmentedControl items selected (food or wine) and is displaying the right data. But as soon as I try to select the other item the app crashes saying "Program received signal: “EXC_BAD_ACCESS”.". Sadly the debugger does not give me any legible information to know where the exception happens, so I inserted breakpoints and it seems to happen in
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
MenuSubsections* menuSubsection = [self.menuSubsections objectAtIndex:section];
if (![menuSubsection menuItems]) {
return 0;
}
return [[menuSubsection menuItems] count];
}
in the last line.
I inserted a NSLog for menuSubsection and it says, among other stuff that is right,
menuItems = "<relationship fault: 0x8133540 'menuItems'>";
But it also gives the same message when starting up and working fine...
Any idea?
Thanks,
Miguel