Reputation: 22236
I'm trying to run an iOS7 project under Xcode6 on an iOS7 device. At first all seemed to be A-OK, but then I noticed that all images that reside in Images.xcassets don't show up at runtime.
I can see then correctly in design (storyboard), and I see them if I run the app in the simulator.
Anyone having an idea how to fix this? Thanks!
NOTE: the project runs fine on Xcode5.x therefore it's not the usual culprit (mismatch in the image name "casing").
ADDITIONAL NOTE: I've just tried with another iOS7 project: same problem...
ADDITIONAL NOTE: I've tried using image assets in a brand new project created under Xcode and... images show up.
Upvotes: 11
Views: 8375
Reputation: 9015
I suddenly add jpg image to Image Assets. When resaved in png, all work OK
Upvotes: 4
Reputation: 22236
I've just read about Xcode 6 beta 2: the problem will be fixed.
Downloading it as I'm writing :)
Upvotes: 2
Reputation: 3524
Great find @o KB o! I've also found it surprisingly hard to get rid of asset bundles in my project when switching away from asset bundles and including images directly in my project.
Here's my full workaround:
.xcassets
image bundle to a new directory (let's call it Images/
). See below for a script to make this easier..xcassets
bundle. (surprisingly, removing it from the project isn't enough. In my testing, if the .xcassets
bundle was anywhere in the same directory as the Xcode project or related sources, it would get copied in. Alternately, you can remove the .xcassets
extension)Images/
to your Xcode projectTo make step #1 less tedious, I wrote a script to copy images out of the .xcassets
bundle and into a directory of your choice: https://github.com/johnboiles/xcasset_exporter
mkdir Images
./xcasset_exporter.py MyProject/Images.xcassets Images
Upvotes: 2
Reputation: 4650
Something I found in the Xcode 6 Beta Release Notes:
Images from asset catalogs in projects with a minimum deployment target of iOS 7 or OS X 10.9 will be available when running on iOS 8 and OS X 10.10, but not iOS 7 and OS X 10.9.(17029658)
Upvotes: 13
Reputation: 41
I had the same problem, I have noticed that if I move my images from Images.xcassets to the "Supporting Files" folder, the images show up on iOS7. I Hope this helps
Upvotes: 4