Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa windows

Cocoa windows
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2004
Status: Offline
Reply With Quote
Dec 2, 2004, 01:39 PM
 
Hi,

I have already posted this easy question to http://mymac.ws forum and still not received answer.

I am new to cocoa programming and have a problem :-/ I want to show modeless window when user clicks a menu item, but this window should be released from memory after the user closes it. I wrote the following code:

if (!myPanel) {
myPanel = [[MyPanel alloc] init];
}
[[myPanel window] showWindow:self];

and set "release after close" attribute in Interface Builder.

The question is how to empty myPanel variable (set it to null) when user closes the window using the red close button? Or may be is there any other way to do this?

Thanks.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 2, 2004, 05:03 PM
 
Well, it's not going to use any less memory to set the variable to nil, but if you want to know when it's closed, you should subscribe to the window's close notification.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2