I have resources:
Test.png
test1.jpg
tesT2.jpg
tEst3.jpg
I need to show this image in UIImageView
. So I wrote:
imgView.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[myObject.filename stringByDeletingPathExtension] ofType:[myObject.filename pathExtension]]];
myObject
is entity in my model. I get filename
from xml, but in xml it have format like:
filename="test.png"
filename="test1.jpg"
filename="test3.jpg"
filename="test3.jpg"
So my Image is (null)
because in pathForResource I search @"test" ofType "png"
, but need @"Test" ofType"png"
.
How I can get correct resources without renaming them?