• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [LearningCocoa explainStrangeness];
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.)


References: 
 >[LearningCocoa explainStrangeness]; (From: Christophe ANDRES <email@hidden>)

  • Prev by Date: [LearningCocoa explainStrangeness];
  • Next by Date: Re: Cocoa/EOF for non-enterprise apps Re: proof of cocoa
  • Previous by thread: [LearningCocoa explainStrangeness];
  • Next by thread: Dual monitor support in Cocoa?
  • Index(es):
    • Date
    • Thread