Looks like you are using the AWS SDK with Grand Central Dispatch, and calling synchronous getObject:
and updating UIs on the same thread. You need to make sure to call getObject:
on a background thread, and update UIs on the main thread. Your code should look something like the following:
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
for(int i=0;i<ads.count;i++){
NSString *phot =[ads objectAtIndex:i];
NSLog(@"hna%@",phot);
S3GetObjectRequest *getObjectRequest = [[S3GetObjectRequest alloc] initWithKey:phot withBucket:@"olfactifPhoto"];
S3GetObjectResponse *getObjectResponse = [[AmazonClientManager s3] getObject:getObjectRequest];
dispatch_async( dispatch_get_main_queue(), ^{
UIImage *tampon = [[UIImage alloc] initWithData:getObjectResponse.body];
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:tampon];
tempImageView.frame = CGRectMake(10,currentXLocation, 300, 310);
NSLog(@" il est dans la position %f",tempImageView.frame.origin.y);
self.monImage = tempImageView;
[scroll addSubview:monImage];
});
}
});