Today in the import of a picture, when the real machine test, found an error, but does not affect the operation, but the real machine will not show error errors, and then find the information themselves, it is because the image optimization level can generate a minimum file size, but there is a very bad disadvantage, is very time-consuming, In Xcode there is a setting, this option will probably make your PNG image swell, but you can again Xcode build settings inside settings, such as
By default, commpress PNG files is turned on, closed to run, and found to be a perfect solution for errors.
There is another way to put the picture into the bundle (make bundle method, create a folder, put the content in, and then rename the folder suffix to the bundle is OK). Then add the bundle into the project, as follows
First you need to add #import <QuartzCore/QuartzCore.h> header files
NSBundle *bundle = [NSBundle bundlewithpath:[[nsbundle mainbundle]pathforresource:@ "bundle" ofType:@ "bundle"]];// Get the bundle you set
NSString *imagestr = [Bundle pathforresource:imagename oftype:@ "PNG"];//look for imageName under the path behind the picture is the format, the return value is the absolute path of the picture
[_imgview setimage:[uiimage imagewithcontentsoffile:imagestr]];//adds the picture to the ImageView attempt.
Finally thanked Yumbo main facingsun688 's post.
Picture compilation error