Re: NSWindow alloc/dealloc problems
Re: NSWindow alloc/dealloc problems
- Subject: Re: NSWindow alloc/dealloc problems
- From: Lorenzo <email@hidden>
- Date: Mon, 29 Nov 2004 12:06:38 +0100
I suppose the crash comes from some other object within the window.
Try to create a new brand project, then alloc and init a window, then
release it. If it works, go and add other objects to the window, e.g. the
NSView (not retained). Remember that when you add an object to an already
retained object, the last object you add doesn't really need to be retained.
Best Regards
--
Lorenzo
email: email@hidden
> Message: 16
> Date: Mon, 29 Nov 2004 04:32:52 -0500
> From: Alex Reynolds <email@hidden>
> Subject: Re: NSWindow alloc/dealloc problems
> To: j o a r <email@hidden>
> Cc: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> I tried [targetWindow release] and I get the same crash.
>
> I have also tried:
>
> [targetWindow setReleasedWhenClosed:YES];
>
> when the targetWindow is allocated.
>
> When I then try [targetWindow close], the first time I release my
> targetWindow it seems to work, but then when I allocate targetWindow
> again, it crashes with a type 11 error.
>
> I think only one targetWindow is being allocated, so I don't know why
> [targetWindow close] doesn't release that one object, so that the
> [NSWindow alloc] can run properly.
>
> Are there tools I can use to keep track of how many targetWindow
> objects there really are?
>
> -Alex
_______________________________________________
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