• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: app controller's dealloc not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: app controller's dealloc not called


  • Subject: Re: app controller's dealloc not called
  • From: Karim Morsy <email@hidden>
  • Date: Sat, 18 Mar 2006 11:17:01 +0100

Hi Tito,

thanks for the hint. now my app controller is registered for the NSApp..willterminate notification.
when I quit the app applicationWillTerminate: gets called. in order to deallocate the object I have to send release 3x to self (I wanted to avaoid sending "dealloc" directlyy to self):
[self release]; [self release];[self release]; I have only instantiated the controller once in IB... how come its retain count = 3 ?


thanks,
Karim


On Mar 18, 2006, at 10:09 AM, Tito Ciuro wrote:

Hi Karim,

Check what the docs (NSApplication) states:

applicationWillTerminate:

- (void)applicationWillTerminate:(NSNotification *)aNotification

Discussion
Sent by the default notification center immediately before the application terminates. aNotification is always an NSApplicationWillTerminateNotification. You can retrieve the NSApplication object in question by sending object to aNotification. Put any necessary cleanup code in this method.



Regards,

-- Tito

On 18/03/2006, at 0:38, Karim Morsy wrote:

Hi,

I have an app controller that I instantiate in interface builder.
I release the objects I allocated in my app controller in its dealloc method.
however, when I quit the application my dealloc method won't get called. I always thought that instances created in IB automatically get sent dealloc when the app terminates....
any ideas what might be missing here ? do I have to work with a delegate for NSApplication or is there a more convinient way ?


many thanks in advance,
Karim
_______________________________________________
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


_______________________________________________ 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
References: 
 >app controller's dealloc not called (From: Karim Morsy <email@hidden>)
 >Re: app controller's dealloc not called (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: Learning MallocDebug/Leaks
  • Next by Date: Re: classes in frameworks
  • Previous by thread: Re: app controller's dealloc not called
  • Next by thread: Re: app controller's dealloc not called
  • Index(es):
    • Date
    • Thread