• 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: How do I call a function when my preference pane bundle closes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I call a function when my preference pane bundle closes?


  • Subject: Re: How do I call a function when my preference pane bundle closes?
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 29 Oct 2008 10:56:30 -0600


On Oct 29, 2008, at 10:22 AM, Adam Penny wrote:

I want to save preferences when the user either closes the preference pane window, clicks the show all button or quits system preferences. Can I just put the method call in the -(void)dealloc or is this a bad idea?


Bad idea. -dealloc is reserved for nullifying pointers in other objects, releasing objects, etc. Your idea will also break if the pane never gets deallocated, and will also fail if preference panes ever support GC in the future. I would recommend just setting preferences as you go; this is not an expensive thing to do.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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


References: 
 >How do I call a function when my preference pane bundle closes? (From: Adam Penny <email@hidden>)

  • Prev by Date: Re: How do I call a function when my preference pane bundle closes?
  • Next by Date: Re: How to show Interface Builder's build warning and messages?
  • Previous by thread: Re: How do I call a function when my preference pane bundle closes?
  • Next by thread: Is there an equivalent to std::min/std::max for Cocoa programmer's
  • Index(es):
    • Date
    • Thread