我想将 icdcodeDictionary 添加到 backlist 中,但它会更改 backlist 的所有元素。在此过程之后,它们与最后添加的项目相同。我该如何解决这个问题?我跟着这个链接。http://iphonedevsdk.com/forum/iphone-sdk-development/88286-adding-object-to-nsmutablearray-changes-all-objects.html 但什么也没发生。谢谢。
NSMutableDictionary *icdcodeDictionary;
@property (nonatomic, retain) NSMutableArray *backlist;
[self.backlist addObject:icdcodeDictionary];
的结果
NSLog(@"backlist %d 索引: %@",self.backlist.count-2,[icdcodeDictionary objectForKey:@"Name"]);
NSLog(@"backlist %d index: %@",self.backlist.count-1,[icdcodeDictionary objectForKey:@"Name"]):
backlist 0 index: Urlar
backlist 1 index: Urlar
但我想要这个:
backlist 0 index: Neoplazma backlist 1 index: Urlar