Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does resource bundle copy .png as .tiff images?

I've created a static library and a resource bundle for reusing code and assets across several projects.

Within the static library, I have a manager class whose sole purpose is to create other UIViewControllers, whose views are created from .xib files (using the common initWithNibName:bundle: method).

When I create the view in Interface Builder, the images show correctly. However, when I run the app on the simulator, I get this error:

    Could not load the "<image_name.png>" image referenced from a nib in the 
    bundle with identifier "com.<my_company>.<app_identifer>"

After hours of grinding, I finally inspected the resources bundle, and I found that the .png files weren't in it! Instead, .tiff files of the same name (excluding @2x versions) were there instead.

All of the images are included within the bundle's build phase under copy bundle resources , and I've used the images on other iOS projects (so they're not corrupted).

Has anyone else experienced this? Is it safe to assume that the images will always be added to the bundle as .tiff? (And if so, is it safe to just change the image name in interface builder to .tiff?) Or am I doing something incorrect here?

Thanks for your help in advance.

like image 411
JRG-Developer Avatar asked Sep 24 '12 07:09

JRG-Developer


2 Answers

For the issue of resource bundles , refer to this link as it has a couple of similar faced queries.

Conversion Resource bundle

Tell me which answer really helped you solve this issue. Thanks.

like image 65
IronManGill Avatar answered Oct 31 '22 03:10

IronManGill


This Solved my problem

In your bundle target Go to,

Build Settings > COMBINE_HIDPI_IMAGES and set to NO

like image 37
Mohammad Zaid Pathan Avatar answered Oct 31 '22 05:10

Mohammad Zaid Pathan