Ja. Wenn Sie zwei Schlüssel haben, die auf dasselbe Objekt zeigen, stellt NSKeyArchiver sie als Schlüssel wieder her, die auf dasselbe Objekt zeigen.
NSString *one = @"1";
NSString *two = @"2";
NSMutableDictionary *dict = [[[NSMutableDictionary alloc] initWithObjectsAndKeys:one, @"one", two, @"two", one, @"three", nil] autorelease];
NSLog(@"one=%d, two=%d, three=%d", [[dict objectForKey:@"one"] hash], [[dict objectForKey:@"two"] hash], [[dict objectForKey:@"three"] hash]);
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict];
dict = nil; // no tricks!
dict = [NSKeyedUnarchiver unarchiveObjectWithData:data];
NSLog(@"one=%d, two=%d, three=%d", [[dict objectForKey:@"one"] hash], [[dict objectForKey:@"two"] hash], [[dict objectForKey:@"three"] hash]);
THX Ich wollte hören: D U machte meinen Tag! –
@ user408141, habe ich einen Code eingegeben, um diese Aussage zu bestätigen. –