Master-detail problem: After editing, detail switches back to original value
Master-detail problem: After editing, detail switches back to original value
- Subject: Master-detail problem: After editing, detail switches back to original value
- From: Christian Gottschall <email@hidden>
- Date: Thu, 16 Sep 2004 22:09:11 +0200
Hi,
I hope that my problem is not too stupid, but I am a little perplexed
and cannot easily see what I have done wrong.
I have a simple master-detail interface. There is an NSArrayController
with the following contentArray binding: "Bind to" is set to "File's
owner" which is a subclass of NSWindowController, say,
"MyArrayController". "Controller Key" is empty, and "Model key path" is
set to "document.myArray". By these settings I hope to bind the array
controller to my document's array "myArray". Indeed this works so far.
Now I have a window with a NSTableView whose columns are properly bound
to several attributes of MyArrayController. This works fine, too: The
table correctly shows my document's "myArray".
But finally, my window contains several NSTextFields (the details) with
the following value binding: "Bind to" is set to "MyArrayController".
"Controller Key" is set to "selection". "Model Key Path" is set to some
respective attribute of the objects stored in "myArray". Here is where
things start not to work as expected:
When I select an entry of the NSTableView, the NSTextFields still take
the appropriate values, i.e. reflect the object selected in the list.
But when I edit one of these (detail) NSTextFields, strange things
happen:
1. The edit properly takes place, i.e., editing basically works. As
soon as I finish editing by leaving the NSTextField e.g. by pressing
"Tab", the edited value is shown in the NSTableView.
BUT:
2. At the same time, the NSTextField I have edited switches back to the
original value, i.e. the value the object had before editing!
3. Only when I select a different row in the table and then re-select
the row whose object I had been editing, the NSTextField again displays
the proper value.
I don't know what I have done wrong, and I begin to fear that I might
have misunderstand something rather important and, probably, basic.
Maybe someone can point me in the right direction...?
Best regards,
Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden