I want to get many images from diffrent url and set it like image's buttons . I was trying to do this like it's showing above but nothing is happen . When i access this view controller it doesn't have any image for buttons and also neither the banner view is not showed... .
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
NSURL *url = [NSURL URLWithString: [pictureUrl objectAtIndex:i]];
NSData *data = [[NSData alloc] initWithContentsOfURL:url];
dispatch_async(dispatch_get_main_queue(), ^(void){
UIImage *img1 = [[UIImage alloc]initWithData:data];
img2.image = img1;
[bt setBackgroundImage:img2.image forState:UIControlStateNormal];
});
});
Try this modification,
Hope it help.