我想添加一个新元素'单元格到我的UITableView,以便在文字输入和点击后输入'必须创建新条目。像here之类的东西,但只在列表的末尾。我怎样才能做到这一点?在我的UITableViewController中,我使用NSFetchedResultsController来处理Core Data的操作。
答案 0 :(得分:0)
您需要修改tableView委托和数据源方法以包含额外的行:
numberOfRowsInSection
以返回FRC sectionInfo count 加一 cellForRowAtIndexPath
等于FRC sectionInfo计数(即最后一行),则修改indexPath.row
以使用不同的小区标识符出列。相应地配置单元格。didSelectRowAtIndexPath
以触发添加新条目的代码。editingStyleForRowAtIndexPath
),以确保它们检查indexPath.row
并适当处理额外的行。