• 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: Unarchiver problems!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unarchiver problems!


  • Subject: Re: Unarchiver problems!
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 26 Mar 2005 07:23:02 -0600


On Mar 25, 2005, at 11:41 PM, glenn andreas wrote:


On Mar 25, 2005, at 11:29 PM, Tom Birch wrote:

This is following on from my "Bindings problems" thread, I have reduced the problem down to something with NSUnarchiver, or, something. Here is a gdb trace that should give you a fair idea of what is going on:

http://tbir905.web.cse.unsw.edu.au/gdbsession.txt


38 - (id)initWithCoder:(NSCoder *)coder 39 { 40 if(self = [super init]) 41 { 42 dict = [coder decodeObject]; 43 } 44 return self;


Line 42 should be dict = [[coder decodeObject] retain];

You could also make use of accessors:

[self setDict:[coder decodeObject]];

where setDict: will do the right thing with memory management.

This is what I do for all my objects for init, initWithCoder, encodeWithCoder, dealloc, etc. In fact, the only code that ever directly accesses ivars for reading/writing is from the accessor implementations.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Unarchiver problems! (From: Tom Birch <email@hidden>)
 >Re: Unarchiver problems! (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: Don't trust -fileExistsAtPath:isDirectory: when symlinks are involved
  • Next by Date: Odd parse error when I try to build
  • Previous by thread: Re: Unarchiver problems!
  • Next by thread: Odd parse error when I try to build
  • Index(es):
    • Date
    • Thread