objective c - NSProgressIndicator determinate when not in loop -



objective c - NSProgressIndicator determinate when not in loop -

i'm using code question, , can't figure out how 'determine' how long task might take. example:

- (void)dosomething { [showprogress startanimation:nil]; dispatch_queue_t backgroundqueue = dispatch_get_global_queue(dispatch_queue_priority_default, 0); dispatch_async(backgroundqueue, ^{ (nsuinteger = 0; < 100; i++) { // whatever need [self gounzipfiles]; // 1mb file or 3gb dispatch_async(dispatch_get_main_queue(), ^{ [showprogress incrementby:1.0]; }); } // done long running task dispatch_async(dispatch_get_main_queue(), ^{ [showprogress stopanimation:nil]; }); }); }

the problem illustration having task unzips file 1 mb or 3 gb - how can programmatically determine how long animate indicator in smooth consistent way whatever duration of task might be? thanks

objective-c osx cocoa nsprogressindicator

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -