Re: Help please... NSTextField not updating via Cocoa Bindings
Re: Help please... NSTextField not updating via Cocoa Bindings
- Subject: Re: Help please... NSTextField not updating via Cocoa Bindings
- From: Steven Palm <email@hidden>
- Date: Fri, 10 Dec 2004 16:46:10 -0600
On Dec 10, 2004, at 1:16 PM, Steven Palm wrote:
I have an NSObjectController with an NSArrayController to control a
group of objects. I have an NSTextField through which I want to update
a status message about the currently selected item in the array.
Simple enough, right? Create an iVar in my object, bind the
NSTextField value to the ArrayController object->selected->iVarName as
keypath, and it will update. (Yes, I did check "continuously updates"
to make sure it would always have the data).
The initial value put there upon either new object creation (init) or
initWithCoder does show up. However, during the course of my program
running in which I spawn a sub-process via NSTask and catch it's
output to update my object's status information, the field never
changes. It will only change after I quit the sub-process!
I put calls into the setter accessor method, and I do indeed see that
the events are firing as they should, and the object's value is
getting updated. A few other parts of the GUI also change their
enabled state, etc., based on values in the object that also change
while the task is running, but they don't seem to be having any
problems. I'm not using any validators, value transformers or
anything on this.... the iVar is a simple NSMutableString and I just
want the NSTextField to always show it's current value. ;-)
Any clues on how to track this one down? Please??? :-)
Okay, a few more notes... I am getting the status updates from a
socket connection... I'm using the AsyncSocket package for this. It
appears that the issue is related to the fact that AsyncSockets sets up
it's own CFRunLoop, and when my methods are called they are from in
this runloop.
As a temporary workaround I am posting a notification about the
change, cautching it in one of my other objects that would be running
in my initial NSRunLoop and having it update the GUI itself. I can't
recall if I tried having this method change the instance variable in
the original object or not, I may do that tonight.
Are Cocoa Bindings affected when you have multiple runloops going, or
am I way off track on the cause of the problem?
Steve
_______________________________________________
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