dimanche 3 juillet 2016

My label is not being updated on runtime


My label and progressView is not being updated on runtime

-(void)updateProgressBar {

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{        

        dispatch_async(dispatch_get_main_queue(), ^{ 
            self.lblNo.text = [NSString stringWithFormat:@" OY %f",i]; 
            [self.lblNo setNeedsDisplay];           
            self.progressView.progress = iProgressCount;        
        });
      
        [NSThread sleepForTimeInterval:0.10];         
     });     
 }  

-(void)updateReceivedData {      

    i = i + [self.arrayContacts count];        
    if (i < [self.arrayContactsTemp count]) {
        iProgressCount = (i * 100)/[self.arrayContactsTemp count]; 
        [self updateProgressBar];     
    } else {
        [self updateProgressBar];
        [self dismiss];
    } 
}

Aucun commentaire:

Enregistrer un commentaire