Re: Cocoa-dev Digest, Vol 5, Issue 268
Re: Cocoa-dev Digest, Vol 5, Issue 268
- Subject: Re: Cocoa-dev Digest, Vol 5, Issue 268
- From: Daniel Child <email@hidden>
- Date: Tue, 19 Feb 2008 17:18:12 -0500
Thanks Bill & Hamish,
Changing the init method worked. I am still a little puzzled though.
I later renamed the ivar to localDataCopy (which certainly wouldn't
be a part of the NSWindow class), and the same error occurred. My
accessors definitely assume an NSMutableDictionary. Does that mean a
memory-munching bug????
In any case, it works fine. now. Thanks.
Daniel
On Feb 19, 2008, at 3:04 PM, email@hidden wrote:
Hamish is correct in that this should be structured something like:
- init
{
if (self = [super initWithWindowNibName: @"Step1Window"]) {
data = [[NSMutableDictionary alloc] init];
}
return self;
}
Given that you declared the instance variable in the class w/the init,
super better not be replacing your ivar!
So, how could data become a non-mutable object?
(1) Unarchival generally produces immutable objects unless you
explicitly ask for mutable objects.
(2) You released data and replaced it with a reference to an immutable
object
(3) You have a memory munching bug
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden