Objective-c memory mode for background image

I have an ipad application (> 30 views / pages), each of which has a unique background.

problem: What is the best way to set the background (memory compatible)

is there a better way than adding: uiimageview "backgroundView" as a subtitle?

version1:

[[UIImage alloc] initWithData:imageData];

which seems problematic with a retinal switch

version2:

self.layer.contents = (id)image.CGImage;

version 3:

UIImage* image = [UIImage imageWithContentsOfFile:fileLocation];

version 2 seems to be working fine. maybe someone will tell me what works best and why;)

thanks Alex

+3
source share
2 answers

CGImageproblematic with the retina ... version3. best for memory!

+1
source

2 , , ARC. 3 .

. 3, , .

[UIImage imageNamed: @ "image-name.png" ], .

, , PVR, .

,

0

All Articles