【发布时间】:2014-06-10 06:30:13
【问题描述】:
我有一个 NSMutableDictionary Test = {key1:[0,0,0,0],key2:[0,0,8,0,0]}..这里数组是 NSMutableArray。我需要更新一些值字典内的数组。例如。
- (IBAction)update(id)sender {
UIButton *button = (UIButton *)sender;
int test = 9;
UIView *contentView = button.superview;
UIView *viewWithTag16 = [contentView viewWithTag:16];
NSIndexPath *indexPath = [self.dataColletionview indexPathForCell: (DataColletionViewCell *)[[sender superview]superview]];
NSLog(@"flag values...%@",_flag);
......................
.....................
}
这里 indexpath.row 将是一个变量整数,标志将类似于 key1、key2、key3 类似于字典中的键。基于整数 a 值和 _flag 值,我需要更新字典中的数组值。示例_flag = key2 和 indaexpath.row = 3。我需要将测试整数值更新到第二个数组(key2)的第三个位置。
【问题讨论】:
标签: ios objective-c xcode nsmutablearray nsmutabledictionary