With your code, you are using AFNetworking to download a JSON file with the 'back_url', then you are downloading the image in the main thread, instead of this code:
if(![backurlJSON isEqualToString:@""]){
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.mydomain.com/images/%@", backurlJSON]];
NSData *data = [[NSData alloc]initWithContentsOfURL:url ];
imgBack = [[UIImage alloc]initWithData:data ];
backgroundView = [[UIImageView alloc] initWithImage: imgBack];
}
You can use something like:
NSString *backurlJSON=[user valueForKeyPath:@"back_url"][0];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.mydomain.com/images/%@", backurlJSON]];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFHTTPRequestOperation *postOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
postOperation.responseSerializer = [AFImageResponseSerializer serializer];
[postOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
backgroundView.image = responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Image error: %@", error);
}];