so i have a simple view that is a SCViewController and on it, is a tableivew thats hooked up the to outlets as the tableView, and a segment control that when pressed reloads the table to display a different predicate
simple enough:)
but when i press the segment control, the tableview reloads and does what i want, but i see that in instruments (not leaking) but building up and not releasing objects each time the segment is pressed
so simple code is just, when the segment is pressed
NSPredicate *predicate = nil; if (self.segmentControl.selectedSegmentIndex == 0) { predicate = [NSPredicate predicateWithFormat:@"complete == %@", @NO]; } else if (self.segmentControl.selectedSegmentIndex == 1) { predicate = [NSPredicate predicateWithFormat:@"complete == %@", @YES]; } else if (self.segmentControl.selectedSegmentIndex == 2) { predicate = [NSPredicate predicateWithFormat:@"dueDate < %@ && complete == %@",[NSDate date], @NO]; } SCArrayOfObjectsModel *taskModel = [SCArrayOfObjectsModel modelWithTableView:self.tableView entityDefinition:self.taskDef filterPredicate:predicate]; self.tableViewModel = taskModel; [self.tableViewModel reloadBoundValues]; [self.tableViewModel.tableView reloadData];
so like i said it works in that the table reloads and displays exactly the objects its meant to, but in instruments i have 100's of objects that stay put and on each loop of the segment more and more are loading
so there must be a proper way to set the tableViewModel and that i am doing something wrong here?
Oz