         }
         var rows = sections[section].numberOfObjects
         logger?.logVerbose(message: String(format: "[%@(%@)] Fetched results controller has %i objects.", instanceType(self), self.fetchedResultsController.fetchRequest.entityName!, rows))
-        if !hideAddItemRow && section == 0 {
+        if tableViewDelegate.crudViewControllerShouldShowAddItemRow(crudViewController: self) && !hideAddItemRow && section == 0 {
             logger?.logVerbose(message: String(format: "[%@(%@)] Including 'Add object' cell in row count.", instanceType(self), self.fetchedResultsController.fetchRequest.entityName!))
             rows += 1 // add one row for the "add object" row
         }

extension CrudViewController: UITextFieldDelegate {

    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        setTableView(toHideAddItemRow: true)
        return true
    }

    func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
        setTableView(toHideAddItemRow: false)
        return true
    }


    }

    func indexPathPointsToAddObjectRow(indexPath: IndexPath) -> Bool {
        if !tableViewDelegate.crudViewControllerShouldShowAddItemRow(crudViewController: self) || hideAddItemRow {
            return false
        }
        
