Narayana Rao Routhu
Narayana Rao Routhu

Reputation: 6323

Not loading images From Resource folder in iphone

I have strange behavior in my app. In My app i am using below code get images from resource folder..working fine at starting but if i test my app continuously one hour after that i am not getting any images from resource folder then in my all view coming without back ground image...

[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"box_s3_landscape" ofType:@"png"]]  

Upvotes: 0

Views: 503

Answers (2)

Shrey
Shrey

Reputation: 1977

[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"box_s3_landscape" ofType:@"png"]]

This line of code does not caches your Image.

try using [UIImage imageNamed@""];

Upvotes: 1

Srikar Appalaraju
Srikar Appalaraju

Reputation: 73688

Are you running this in Simulator? The Resources/iphone directory should work fine. This is a simulator-only issue, which has been resolved for 1.8.0

Upvotes: 0

Related Questions