ios7 - UIImage imageWithContentsOfFile does not work (ImageNamed works fine) -



ios7 - UIImage imageWithContentsOfFile does not work (ImageNamed works fine) -

i struggling display image.

the next codes work fine.

imageview.image = [uiimage imagenamed:@"picture"];

or

imageview.image = [uiimage imagenamed:@"picture.png"];

but next codes not work.

nsstring *theimagepath = [[nsbundle mainbundle] pathforresource:@"picture" oftype:@"png"]; imageview.image = [uiimage imagewithcontentsoffile:theimagepath];

or

imageview.image = [[uiimage alloc] initwithcontentsoffile:[[nsbundle mainbundle] pathforresource:@"picture" oftype:@"png"]];

i tried clean project has not fixed yet. have same experience?

imageview.image = [[uiimage alloc] initwithcontentsoffile:[[nsbundle mainbundle] pathforresource:@"picture.png" oftype:nil]];

give shot, xcode not recognize file png file.

but why don't remain imagenamed:?

ios7 uiimage xcode5

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -