[LearningCocoa explainStrangeness];
[LearningCocoa explainStrangeness];
- Subject: [LearningCocoa explainStrangeness];
- From: Christophe ANDRES <email@hidden>
- Date: Mon, 18 Jun 2001 13:30:09 +0100
While going through "Learning Cocoa", I came on something that does not
seem to make any sense (at least it does not for me). Could someone
enlighten me ?
Here is the problem:
In chapter 10 (Travel Advisor sample), the init method contains the
following code
countryDict = [NSUnarchiver unarchiveObjectWithFile:storePath];
which builds the dictionary, but then a few lines later it does this :
countryDict = [[NSMutableDictionary alloc]
initWithDictionary:countryDict];
Why would it be necessary to recreate the dictionary, initializing it
with the one recreated through the NSUnarchiver stuff ??
Is the result of NSUnarchiver not a NSMUtableDictionary (getting back a
NSDictionary instead of a NSMutableDictionary would be the only thing
that makes sense for me)
Well I'm a bit confused by that.
Any help appreciated
Christophe