tags:

views:

30

answers:

1

Hi, I am using the new Retina display feature of ios 4.0 in my iphone application. I added the images for higher resolution with the naming convention as [email protected] to my existing image folder.

eg. I am adding the image in the following way:

UIImageView *toolBarBg=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,88) ];

NSString *toolBarBgImgPath=[[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:@"bg_btm_bar.png"];

[toolBarBg setImage:[UIImage imageWithContentsOfFile:toolBarBgImgPath]];

I am having the image named "[email protected]" in my image folder as well.

But when I am running my application it is not taking the higher res image.

I am not understanding that how to make the application use the higher res image. Please help me out!

A: 

Use imageNamed: instead of imageWithContentsOfFile:

hotpaw2
http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/SupportingResolutionIndependence/SupportingResolutionIndependence.html#//apple_ref/doc/uid/TP40007072-CH10-SW3It is mentioned in the above link that "imageWithContentsOfFile" can also be used. But then also I tried imageNamed ,but the problem is same.
iphoneDev