我可以使用“添加按钮”进行推送转换,但我还需要以编程方式执行此操作。当我以编程方式执行此操作然后返回“添加按钮”变为灰色。我调试了它,我可以看到_tflet中的_defualtAttributes已经改变了。颜色值已更改。为什么会改变?怎么预防呢?看起来很混乱。
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance];
[addPalletViewController setEditMode:true];
[addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]];
[[self navigationController] pushViewController: addPalletViewController animated:YES];
}
答案 0 :(得分:0)
将此代码替换为您的代码..
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance];
[addPalletViewController setEditMode:true];
[addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]];
[[self navigationController] pushViewController: addPalletViewController animated:YES];
//Will deselect your row...
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}