Setting NSObjectController's to file's owner
Setting NSObjectController's to file's owner
- Subject: Setting NSObjectController's to file's owner
- From: André Pang <email@hidden>
- Date: Thu, 15 May 2008 17:21:23 +1000
Hi all,
I have a nib file containing an NSObjectController. The
NSObjectController's content is set to the File's Owner proxy object,
and this creates a retain cycle. (The file's owner never gets
deallocated because the object controller retains it, and the object
controller never gets deallocated because the file's owner retains it
as an IBOutlet.)
This is obviously a bad thing to do, but I always thought that it was
good design for views and controls to be bound to an
NSObjectController rather than the file's owner directly, since
NSObjectController then takes care of all the NSEditor protocol stuff,
you get auto-completion for model key names in Interface Builder,
etc. Is there a better method than what I'm doing? (I would think
that setting an NSObjectController's content object to the file's
owner is a reasonably common scenario, so I can't be alone in
experiencing this memory leak.) Binding a control directly to the
file's owner seems kinda skanky.
Also, I've Googled around a ton and found a lot of references to
memory leaks that occur when binding to the file's owner, but it
appears that those bugs are fixed up in 10.4. (The last messages and
blog posts I saw about this topic were from 2004.) Is that correct?
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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