[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Releasing objects owned by Gorm interface element

From: Samuel Hornus
Subject: Re: [Q] Releasing objects owned by Gorm interface element
Date: Thu, 9 Dec 2004 02:32:43 +0100

Gregory wrote:
> It is the responsibility of the app to release certain top level
> objects contain in the nib (in this place, gorm) file.
> Here is a good place to start: 

> You need to maintain a connection to any windows, menus, controllers
> or other toplevel objects you have created.   Generally, these are the
> objects you see in  IB/Gorm in the "Objects View".
> Please make sure you are correctly deallocating these.

Hi Gregory,
Thank your for the link.
I discovered the - (BOOL)applicationShouldTerminate:(id)sender
that can be implemented into the NSApp's delegate.

In this method, I am able to release my custom view. This works.

My interface has one button, one custom view, the main menu; I guess I
don't have to release the main Menu and the button manually, am I right

Then, the only object left is the NSApp's delegate itself. It is
instanciated it Gorm and set as the App's delegate in Gorm as well. How
can I properly release this delegate ?

For the moment, I implemented this as follows...
is that correct ?

// Application's delegate implementation :

// The Log can be seen when I quit the App, cool :-)
- (void)dealloc
    NSLog(@"Fairing Manager is deallocating...");
    [view release]; // view is my Custom NVOpenGLView
    [super dealloc];

- (NSApplicationTerminateReply)applicationShouldTerminate:(id)sender
    [self release];
    return NSTerminateNow;

Samuel Hornus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]