I am using STV to present UI for detail view off of a custom tableview using custom cells defined in xib files. I plan to try out the beta to replace this tableview but I am curious as to what I am doing wrong before I move on.
My model is simply
CheckListItem [has a] CheckListItemGroup [has a] CheckList
When I use the following code, the CheckListItem detail view is beautiful and works perfectly. I can follow the relationship from CheckListItem to CheckListItemGroup. I can update the CheckListItemGroup title attribute but the relationship from CheckListItemGroup to CheckList does not present a lookup row to select and/or modify the CheckList.
How do I tell STV to autogenerate the properties on the entities resulting from walking the relationships?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// get the checklist item for index path
CheckListItem *item = (CheckListItem *)[self.fetchedResultsController objectAtIndexPath:indexPath];
// create a generic UITableViewController to use for detail view
[self setDetailViewController:[[SCTableViewController alloc] initWithStyle:UITableViewStyleGrouped ]];
// create a table view model for sensible tableview
[self setDetailViewModel:[SCTableViewModel tableViewModelWithTableView:[self detailViewController].tableView
withViewController:[self detailViewController]]];
// Create a class definition for CheckListItem
SCClassDefinition *scClassDef = [SCClassDefinition definitionWithEntityName:@"CheckListItem"
withManagedObjectContext:[self managedObjectContext]
autoGeneratePropertyDefinitions:YES];
// Create an SCObjectSection for the detail model
SCObjectSection *objectSection = [SCObjectSection sectionWithHeaderTitle:nil
withBoundObject:item
withClassDefinition:scClassDef];
// add the section to the tableview controller's table model
[[self detailViewModel] addSection:objectSection];
// Push the detail view normally here (assuming self is within a UINavigationController)
[self.navigationController pushViewController:[self detailViewController] animated:TRUE];
}