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 16:14:27 -0400
On Fri, Sep 26, 2008 at 2:45 PM, Daniel Child <email@hidden> wrote:
> I should? Then how do I get the reference back? If windowA is a window
> outlet in my AppController, then first time around I don't do anything. It
> is automatically assigned a reference when the window loads, and I can use
> makeKeyAndOrderFront.
>
> But if I choose to automatically release the window on closing, how do I get
> the variable windowA reassigned to the window? I don't want to reload the
> entire nib because there may be other things in the nib that don't need to
> be reloaded....
Well, it's not good to be doing that in the first place, generally.
Although there are occasional exceptions, it's best to have one window
per nib, and one NSWindowController per window. This has the advantage
of lazy loading which helps performance and memory use, as well as
better organization of the program. However, for windows which get
used repeatedly it's entirely reasonable to keep them around rather
than destroying them and re-creating them when closing and opening
them.
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