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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to