What I'm trying to do seem simple but the implementation is throwing me. How can I force a label to refresh after I change it's value?
I've just created a simple progress window. As the main app is doing something I pop up the progress window and I want to update the values of the label and the progress bar as the loop executes.
I created a new NSWindow and XIB file that has outlets to the label and the progressbar and I'm loading it with this:
_pbWindow = [[ProgressBar alloc] initWithWindowNibName:@"ProgressBar"];
[_pbWindow showWindow:self];
When I call:
_pbWindow.lblProgress1.stringValue = @"Doing this now...";
I can't get the label to actually refresh in the new window.
I have searched here and google and can't seem to find anything to tell me how to do this in a different window, only that if it's in the main window that it will just refresh (as has always been my experience anyway).
I thought maybe it was because the window didn't have focus so I tried opening it modally:
[[NSApplication sharedApplication] beginSheet:[_pbWindow window]
modalForWindow:[[NSApplication sharedApplication] mainWindow]
modalDelegate:_pbWindow
didEndSelector:nil
contextInfo:nil];
And still it doesn't work.