• 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
retaining and releasing a Window Controller.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

retaining and releasing a Window Controller.


  • Subject: retaining and releasing a Window Controller.
  • From: Kevin Bracey <email@hidden>
  • Date: Mon, 9 Aug 2010 18:27:39 +1200

Hi guys,

every time I find myself doing something convoluted I think hey I must be doing this wrong:-)

I have a Report WindowController, that opens a Window from it's own nib. This is great, I can open lots of different Reports all bases on the same Controller. But I only need the Window and the controller to stay around while the Window is open. It's all self contained and nothing else needs reference it.

Is it ok to [self retain] in the Controller's init, then [self release] in the - (void)windowWillClose:(NSNotification *)notification. Is that the best place to do this, I'm not at all sure about an object retaining and releasing itself.

at the moment I'm storing all these reports in an array to stop the controller disappearing out from underneath me and then removing them when the Window closes, I'm sure there's a better way.

Cheers
Kevin_______________________________________________

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

  • Follow-Ups:
    • Re: retaining and releasing a Window Controller.
      • From: Quincey Morris <email@hidden>
    • Re: retaining and releasing a Window Controller.
      • From: Negm-Awad Amin <email@hidden>
  • Prev by Date: Re: Understanding property/synthesize
  • Next by Date: Re: retaining and releasing a Window Controller.
  • Previous by thread: Re: help with linking combo boxes
  • Next by thread: Re: retaining and releasing a Window Controller.
  • Index(es):
    • Date
    • Thread