I want to upload images one by one, not all together. In the following code, imagedata is an array containing the URLs from which I need to upload images. Here is my code, but not success.
-(void)loadSingleImage:(int)buttonTag { UIButton *buttonImage =(UIButton *) [self.view viewWithTag:buttonTag]; NSData *imagesubCategoryData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:[imageData objectAtIndex:buttonTag-30]]]; [buttonImage setImage:[UIImage imageWithData:imagesubCategoryData] forState:UIControlStateNormal]; } -(void)loadImageData { for(int i=0;i<[imageData count];i++) { [self loadSingleImage:i+30]; sleep(0.1); } }
source share