Blocking loops
Blocking loops
- Subject: Blocking loops
- From: email@hidden
- Date: Fri, 16 Jun 2006 14:24:41 +0100
I've got an application that does a fair bit of processing in a while loop...
<Code>
NSString* currentObj;
NSEnumerator* allObjects = [myArray objectEnumerator];
while (currentObj = [allObjects nextObject]) {
[progressBar setDoubleValue:((objIndex / [[fileController content] count]) *
100)];
[progressBar setNeedsDisplay:YES];
// Lots of processing here
} // while
</Code>
Unfortunately, the progress bar doesn't actually move (and the App is
unresponsive) until the loop completes. Is there a simple one line fix to this
(I'm thinking along the lines of Visual Basic's DoEvents() and Delphi's
Application.ProcessMessages()), or do I need to do some weird stuff involving
Notifications, and do away with (no pun intended) the loop?
Thanks for any help offered,
- Drarok
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
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