NSMutableDictionary *backprop;
NSMutableArray *backlist;
[backprop setValue:self.val forKey:@"id"];//NSLog for self.val
[backprop setValue:title.text forKey:@"name"];//NSLog for title.text
[backlist insertObject:backprop atIndex:backlist.count];
这里我补充backprops
一下backlist
。我添加了NSLogs
不同的值。这就是我想要的。但是当我用这段代码记录它们时:
while (i!=backlist.count) {
NSLog(@"%@ %@",[[backlist objectAtIndex:i] objectForKey:@"id" ],[[backlist objectAtIndex:i] objectForKey:@"name" ]);i++;
}
它们都与最后一个对象相同。为什么会这样?谢谢你。