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
Post a Comment