FROM : Daniel Child
DATE : Tue Feb 19 23:18:12 2008
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_removed> 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
DATE : Tue Feb 19 23:18:12 2008
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_removed> 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
| Related mails | Author | Date |
|---|---|---|
| Daniel Child | Feb 19, 23:18 | |
| Bill Bumgarner | Feb 19, 23:22 |






Cocoa mail archive

