• 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 to release my window controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to release my window controller


  • Subject: Re: how to release my window controller
  • From: Torsten Curdt <email@hidden>
  • Date: Sat, 2 Aug 2008 18:50:58 +0200

How many of these are you creating, one?

In this very case just one. In fact I am trying to replace what was a modal dialog before now with non-modal window. So the AppController would need to make sure there is only one instance. But this raised the general question how to deal with this best.


No matter what, the best way is to keep a reference in a master
controller.

That's what I thought.

- If it's just a single window, make an ivar to hold on to the
controller. You don't even need to release it, since you can just
reuse it.

That's what I got working atm. But re-using the window does have implications on initialization. (It would have to get a reset method or something)


If you really want to, then have the window controller
notify you when the window closes, then you can destroy it.

Oh ...right that's option 4 ....but that feels a like a little more work than just calling a selector


If you're not using garbage collection, you can play some tricks, like
having the window controller retain itself, or having the app
controller release the sender of the window-closed callback without
actually keeping track of anything. But generally these only *appear*
to save time, they don't actually help, so I don't recommend it.

You mean in windowWillClose: ?

cheers
--
Torsten
_______________________________________________

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: how to release my window controller
      • From: "Michael Ash" <email@hidden>
References: 
 >how to release my window controller (From: Torsten Curdt <email@hidden>)
 >Re: how to release my window controller (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Coding around a known bug
  • Next by Date: Re: My own listbox
  • Previous by thread: Re: how to release my window controller
  • Next by thread: Re: how to release my window controller
  • Index(es):
    • Date
    • Thread