Tested By:
Suppose there are two pictures named: [email protected], [email protected]
Using Initwithcontentsoffile
nsstring *path = [[ nsbundle   Mainbundle ]  pathforresource : @ " [email protected] "   oftype : @" PNG " ];
UIImage *image = [[UIImage alloc]initwithcontentsoffile:p Ath];
Ipone5 S, iphone6 and iphone6 Plus are all needed @2x/@3x the picture suffix name, otherwise the program will error, loading the picture depends on whether you write is @2x or @3x;
using imagewithname
< Span style= "COLOR: #6600cc" >uiimage *image = [ uiimage &NBSP; imagenamed : @ "test_t" ";
< Span style= "Color:rgb (51,51,51); Font-family:menlo; font-size:13px; Line-height:26px "> in Ipone5 S, Iphone6 and iphone6 Plus are not required to bring @2x/@3x picture suffix name, the program will load the @2x But if you need to load @3x picture, you need to write on @3x
use xib to load pictures, andimagewithname similar, but a little different is that you can't match[email protected],either matchtest_t. png, the program will automatically load [email protected] picture , either match [email protected] , program load [email protected] the figure;
last question, do not know why IPhone6 Plus will load the @2x image, in the case of the picture named test_t. png ? In that case , @3x of the picture meaning is not much, if each time manually to test will be more trouble, this is not science AH ~hope to have a friend to answer, thank you ~o (∩_∩) O
IPhone @2x with @3x picture loading problem