android activity - Objective C UIActivityView stops animating only after a delay -
i not sure why, reason uiactivityindicator spinner stays visible awhile after ask stop spinning. in app, check updates block method callback when check complete after point activity indicator hidden. nslog processed when block called, takes maybe 5-10 seconds indicator disappear. nothing going on in main far can tell, app sitting there. confused...
[self showactivityindicator]; [[self schedulepack] checkforupdates:^(void) { nslog(@"done updating."); [self hideactivityindicator]; }];
the problem access ui element separate thread. try replacing
[self hideactivityindicator];
with
[self performselectoronmainthread:@selector(hideactivityindicator) withobject:nil waituntildone:no];
Comments
Post a Comment