关键我已经做了如下变化值在字典
NSDictionary *dic=[[NSDictionary alloc] initWithObjectsAndKeys:a1,@"0",a2,@"1",a3,@"2",a4,@"3", nil];
NSDictionary *userbtn=[[NSDictionary alloc] initWithObjectsAndKeys:dic,@"button", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:userbtn];
我想改变的关键,当我在tableview中移动单元格。 我发现钥匙的价值不能改变。
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
NSUInteger fromRow = [sourceIndexPath row];
NSUInteger toRow = [destinationIndexPath row];
}
我该怎么办......在上述方法中。
恩......非常感谢。我犯了一个错误,我忘了NSMutableDictionary。我在NSDictionary中存储数据...所以...许多方法是有限的。 – user1535023 2012-07-20 05:49:17
您只需将fromRow与toRow交换即可。那么从哪里来的数据呢?它让我陷入困境。字典不像数组那样灵活......仅仅因为它的数据拥有一把钥匙....... – user1535023 2012-07-20 07:11:39
e ....我修好了它。没有别的难题 – user1535023 2012-07-20 07:43:04