Simple binding not working
Simple binding not working
- Subject: Simple binding not working
- From: Ken Tozier <email@hidden>
- Date: Sat, 9 Apr 2005 20:36:01 -0400
Hi all,
I'm trying to make a text field in a download window display the name
of the file that is currently being downloaded from a camera. I've
pored over the documentation and examples many times and just can't get
it working. The thing is this should be a really basic bindings
problem, but there must be some obscure checkbox or something that's
keeping the changed value from displaying. Any bindings gurus out there
point out what I'm doing wrong?
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?
Anyone see what I'm doing wrong? Is it possible that there is some
combination of checkboxes in the text field attributes or bindings pane
that would block the change from registering?
Thanks
Ken
_______________________________________________
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