I am sure that you cannot upload 2x2 image files remotely in an automatic way. You will need to check the retina screen and then get the corresponding image (s), for example:
UIImage *image; if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){ // @2x NSURL *imageURL = [NSURL URLWithString:@"http://www.example.com/images/ yourImage@2x.png "]; NSData * imageData = [NSData dataWithContentsOfURL:imageURL]; image = [UIImage imageWithData:imageData]; } else { // @1x NSURL *imageURL = [NSURL URLWithString:@"http://www.example.com/images/yourImage.png"]; NSData * imageData = [NSData dataWithContentsOfURL:imageURL]; image = [UIImage imageWithData:imageData]; } UIImageView *yourImageView = [[UIImageView alloc] initWithImage:image];
Dan sandland
source share