Greetings Programs!
When I push the view controller in the following manner, if the filter for the entityDefinition does not return any results, the Add button has no effect. When I navigate down to the points view when in edit mode, the Add button does work if there are no previous records.
section.cellActions.didSelect = { (cell, indexPath) in // If we're in edit mode or adding a new objective, show the detail view. if cell.ownerTableViewModel.tableView.editing || cell.ownerTableViewModel.activeCell == nil || cell.ownerTableViewModel.activeCell.boundObject == nil { (cell.ownerSection as! SCArrayOfObjectsSection).dispatchEventSelectRowAtIndexPath(indexPath) return } // If not, go to the list of points for the objective. let objective = cell.boundObject as! Objective var viewController = SCTableViewController(style: UITableViewStyle.Grouped) viewController.navigationBarType = SCNavigationBarType.AddRight viewController.title = objective.objectiveTitle let tableViewModel = SCArrayOfObjectsModel(tableView: viewController.tableView, entityDefinition:pointDef, filterPredicate: NSPredicate(format: "objective == %@", cell.boundObject)) viewController.tableViewModel = tableViewModel cell.ownerTableViewModel.viewController.navigationController!.pushViewController(viewController, animated:true) }
Wg