Re: showing window causes EXC_BAD_ACCESS
Re: showing window causes EXC_BAD_ACCESS
- Subject: Re: showing window causes EXC_BAD_ACCESS
- From: "Michael Ash" <email@hidden>
- Date: Fri, 26 Sep 2008 13:04:28 -0400
On Fri, Sep 26, 2008 at 11:34 AM, Scott Ribe <email@hidden> wrote:
>> I can't think of a single reasonable use case for it
>
> An app with many windows, many of which can display multiple instances at a
> time--they should be released when closed.
Sure. By the objects that own them. Them's the rules, after all.
> I'd turn the question around--why do people assume that a single instance of
> a window can be closed and then re-displayed, especially when the reference
> to it was obviously not retained properly to begin with.
How was it not retained properly to begin with? The window releases
*itself*. Generally the nib owner will continue to own a reference to
every window inside. But that won't prevent an object which breaks the
rules and does a [self release] from going a way, which is exactly
what happens here.
People quite correctly assume that if they retain an object (whether
explicitly or, in the case of being file's owner of a nib, implicitly)
that this object stays alive until they release it. This NSWindow
setting breaks that contract. Thus my inability to see its usefulness.
As Kyle pointed out, the real problem is that this flag is enabled by
default. NSWindow has more than one setting which will completely
destroy its functionality in non-obvious ways, but all the other
settings are given a sane default in IB.
Mike
_______________________________________________
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