My app has a large size because it's universal and designed for Retina displays. I want to allow the user to download Retina images from my server instead of including them in the app initially.
I tried this with the code below. The only problem is that the images are being stored in the Documents folder, and the app won't recognise them as Retina images
UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.test.com/img2@2x.png"]]];
NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *pngFilePath = [NSString stringWithFormat:@"%@/img2@2x.png",docDir];
NSData *data1 = [NSData dataWithData:UIImagePNGRepresentation(image)];
[data1 writeToFile:pngFilePath atomically:YES];
How should I be saving the images to allow the app to use them?