NSProgressIndicator not showing progress

I have a for loop running on my main runloop. I'm trying to have a progress indicator to show what's happening. The problem is the UI never gets a chance to be updated.

I've looked at NSProgressIndicator progress with For loops? but I can't use their solution. My for loop must be on the main thread - otherwise other parts of my program must be serial to the for loop.

Any ideas on how to force a redraw of the indicator?


ANSWERS:


Send your progress indicator a displayIfNeeded message (a method of NSView).



 MORE:


 ? Can NSTableView column bound to coredata Entity NSArrayController in secondary thread work?
 ? Displaying file copy progress using FSCopyObjectAsync
 ? Displaying file copy progress using FSCopyObjectAsync
 ? Displaying file copy progress using FSCopyObjectAsync
 ? Recommended way to copy arbitrary files using Cocoa
 ? Stop NSFileManager process
 ? Showing File Copy Status on a Progress Bar
 ? Adding an NSProgressIndicator to the dock icon
 ? Adding an NSProgressIndicator to the dock icon
 ? Adding an NSProgressIndicator to the dock icon