Use kind of server and inter PROCESS communicating. Quite complex.
Because a notification is despatched synchronously - UI still get no chance to update.
My solution (based on 2):
Sending notification in a separate thread instead of notifying directly:
- (void) sendProgressNotification: (NSNumber *) percentDeltaValue{
[[NSNotificationCenter defaultCenter] postNotificationName:@"StepPercent" object: percentDeltaValue];
}
// post the progress info
- (void) stepPercentage: (int) percentDelta{
[NSThread detachNewThreadSelector: @selector(sendProgressNotification:) toTarget: self withObject: [NSNumber numberWithInt: percentDelta]];
}
No comments:
Post a Comment