Binding NSDictionary controller to a read-only ivar
Binding NSDictionary controller to a read-only ivar
- Subject: Binding NSDictionary controller to a read-only ivar
- From: Thomas Westfeld <email@hidden>
- Date: Mon, 20 Apr 2009 21:52:22 +0200
Dear all,
I was fiddeling around with the NSDictionary controller to display a
dictionary of NSStrings along with its corresponding keys in a
NSTableView. It works so far, one column is bound to key the other to
value of the arranged objects, while the content of the dictionary
controller is bound to a dictionary in my model object. So far so good.
Now I have a getter method in the model object that returns a
NSDictionary in which the values of the original dictionary have been
altered. This dictionary is generated on the fly and is returned
autoreleased.
Now I unbind the dictionary controller of my dictionary property and
bind it programatically to the read-only dictionary. It works, but
after one run loop I think the dictionary gets released and the
dictionary controller's contend is bound to a released object.
How do I mange it properly?
Do I have to store the altered dictionary as an ivar in the object to
get memory management right?
Thanks in advance for your help
Thomas
_______________________________________________
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