Cocoa UI Elements Not Updating
- by spamguy
I have a few Cocoa UI elements with outlet connexions to an object instantiated within an NSView object, which is in turn put there by an NSViewController. These elements, a definite progress bar and a text label, are not updating: the progress bar is dead and empty despite having its value change constantly, the text label does not unhide through [textLabel setHidden:NO], the text label does not change its string.
What I know:
There's no difference between binding values and setting them in code. Nothing changes either way.
I've checked outlet connections. They're all there.
I've tried [X displayIfNeeded], where X has been the UI objects themselves, the containing NSView, and the main window. No difference.
[progressBar setUsesThreadedAnimation:YES] makes no difference. Interestingly, if I look at progressBar mid-program, _threadedAnimation is still NO.
The object holding all these outlets and performing an import operation is in an NSOperationQueue owned by the NSViewController object.
Thanks!
EDIT: As suggested, I called [self performSelectorOnMainThread:@selector(updateProgress:) withObject:[NSNumber numberWithInt:myObject] waitUntilDone:NO]. (I've also tried waitUntilDone:YES.) It's still not updating. The debugger clearly shows updateProgress: taking place in the main thread, so I don't know what's missing.