Re: NSProgressIndicator not responding to calls outside of AppController class
Re: NSProgressIndicator not responding to calls outside of AppController class
- Subject: Re: NSProgressIndicator not responding to calls outside of AppController class
- From: Randall Meadows <email@hidden>
- Date: Thu, 28 Aug 2008 11:32:06 -0600
On Aug 28, 2008, at 10:37 AM, Martin Stoufer wrote:
I am developing an app that is utilizing some legacy C code that I
have massaged into Objective-C classes. In one of them, I am trying
to drive an NSProgressIndicator view as defined by the NIB for the
project. There is a core processing loop that originally spit out
multiple '.' to stdout as it ran. Now I want to capture a count of
these and update the indicator.
The class has the proper IBOutlet defined in its header file and IB
correctly sees this class (via a new Object I created in IB) and the
IBOutlet I defined for it. I hooked it up properly and now when the
code in the C class runs, the calls to
[myProgressIndicator setDoubleValue:progress] aren't being displayed
in the App.
Are you doing all this in a single loop (e.g., inside the main event
loop)? If so, you aren't giving the main event loop itself time to
service the GUI updates. You can add in a call to
[myProgressIndicator display], but even better would be to break out
this inner loop and put it in a thread (giving the main loop a chance
to execute alongside your loop, and therefore take care of the screen
updates). See NSThread
+detachNewThreadSelector:toTarget:withObject:. This will require some
refactoring...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden