retaining and releasing a Window Controller.
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