Re: [LearningCocoa explainStrangeness];
Re: [LearningCocoa explainStrangeness];
- Subject: Re: [LearningCocoa explainStrangeness];
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 18 Jun 2001 05:43:18 -0700
On Monday, June 18, 2001, at 05:30 AM, Christophe ANDRES wrote:
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)
You got it on the first guess.
-jcr
begin
(If this message looks like it has an attachment, your mail reader is
brain-dead.)