每当我向我的 NSMutableArray 添加一个新对象 NSMutableDictionay 时,它怎么会替换我以前的对象?
例如:
[appDelegate.tracksDict setObject:currentTrackTitle forKey:@"track_title"];
[appDelegate.tracksDict setObject:currentTrackTopic forKey:@"topic"];
[appDelegate.tracksArray addObject:[appDelegate.tracksDict copy]];
它的印刷...
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
topic = "Cold Calling";
"track_title" = "Sleeping and selling";
}
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
topic = "Gate Keeper";
"track_title" = "Selling like a chicken";
}
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
topic = "Gate Keeper";
"track_title" = "Don't you try to sell";
}
而不是像...
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
topic = "Cold Calling";
track_title = "Sleeping and selling";
topic = "Gate Keeper";
track_title = "Selling like a chicken";
topic = "Gate Keeper";
track_title = "Selling like a chicken";
}
我敢肯定这是愚蠢的,因为我不太懂这种语言。