Re: Simple binding not working
Re: Simple binding not working
- Subject: Re: Simple binding not working
- From: Fritz Anderson <email@hidden>
- Date: Sat, 9 Apr 2005 20:34:13 -0500
You say you are instantiating your model object in your NIB file, and
connecting the controller's content outlet to it in IB (by control-
dragging, presumably, and not option-dragging).
You say you are updating the fileName property of an instance of your
model class in your code.
What are you doing to ensure that the instance you update is the same
as the instance from your NIB?
-- F
On 9 Apr 2005, at 7:36 PM, Ken Tozier wrote:
Here's what I did:
1. Defined a "fileName" property in my model class
2. Imported the model class into Interfacebuilder
3. Instantiated the model class
4. dragged an NSObjectController into the IB project and added a
"fileName" property in my model class as an NSString with the key
*fileName" in the attributes pane.
5. Option dragged from the NSObjectController to the Model instance
and clicked the connect button
6. Opened the "Download" window, selected the text field that holds
the file name and connected it to the NSObjectController in the
bindings panel. like so.
Bind To: NSObjectController
Controller Key: selection
Model Key Path: fileName
7. Saved the IB file
8. Saved the Xcode project and rebuilt it
9. Ran the project
Result:
The window opens but the file name field is empty and stays that
way even though I can see through NSLogs that the file name is
getting periodically updated.
I made sure (as per the documentation) to only change the fileName
field in my model object using the "setFileName" method rather than
directly. So the change should automatically register. No?
_______________________________________________
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