Image load on iOS simulator but not on iPad - objective-c

The title pretty much describe my problem. I have a UIButton on which I applied a .png background. The .png load fine on the iOS simulator but not on the actual iPad. Any hints as to why it does that ?
EDIT:
When the view with the button in question loads I get this error message in the console
Could not load the "fosse.png" image referenced from a nib in the bundle with identifier "ca.polymtl.PolyPuttZE"

Try doing this.
In Xcode press:
Command+Shift+K and press Yes.
Command+Shift+Alt+K and press Yes.
The try building, running.
Also, check if the image has correct targets (you can check by clicking on the image in Xcode and then in Inspector you'll find build targets).

I've solved the problem. Turns out that the image wasn't encoded as a png even if it had the proper extension. So I juste opened it with gimp and exported it as a PNG.

Click on your project. Then go to the Build Phases tab and ensure that the file is in the Copy Bundle Resources list.
If not then add it...

Related

Apple Watch Images not showing on simulator

I am working with the apple watch and I would like to just simply set an image in the storyboard. It is a png file and I set it in the storyboard, but it doesn't show up in the simulator. I have tried all of the aspect and fitting options. I believe the view is called a wkinterfaceimage. I have also tried adding programmatically and that does not show up either. Hidden is not checked. Any ideas of what I might be missing?
If you have your image included as a file in your app's bundle select the file, choose File Inspector and add the target under Target Membership:

screen resolution dependent image source

I am developing a Windows 8 metro (yeah!) app. How do i provide a screen resolution dependent image source ?
As per these guidelines, we can achieve it using image naming convention too.
I have an image control as show below.
<Image Source="Assets/test.jpeg"/>
I also have test.scale-100.jpg, test.scale-140.jpg & test.scale-180.jpg images in asset folder. Each image having different icon color to identify which image is loaded.
If i run the app in simulator and change screen resolutions, i still see test.scale-100.jpg for any resolution. Why is this happening ? In which case will the OS load test.scale-140.jpg or test.scale-180.jpg image ?
EDIT: I got it working. Once your app starts in simulator, close it by pressing home buton & uninstall it. In VS, right click on Project and click on Deploy. App should be now deployed to simulator. Change the resolution and start the app. You should now see correct image loaded by OS. Rinse and repeat to test other resolutions.
The scaling is automatic. If your images are correctly named, and you change resolution in the simulator you must restart the app to see scaled images. It doesn't happen on the fly, IIRC.
Finally got it working. close the app and uninstall it from
simulator.
In VS, right click the project and click deploy.
Change to desired screen resolution and start the app. OS should not pick proper image as per resolution.
Rinse and repeat same to test images on various resolutions.

Image not visible on Device but appers on the simulator

In my app I have set custom image for segment control. Image shows up very well on the simulator but not on the device. I checked all possible ways and tried what ever was answered for this issue earlier for the issues same as I have now. But still I can't locate exact solution for this. Can anyone help please.
Did you try removing/readding the image? As far as I know, the simulator has its own cache, if the image has been removed somehow, that may be why its showing up.
You may try:
Remove the image from xcode, and re-adding it
Making a clean build
Remove the image from "bundle resources", (see: https://stackoverflow.com/a/12741872/936957) and readding it
Quitting / restarting xcode
One of them should help

Images in NSButton not showing up?

I've tried that several times, and it seems there is some bug with that (Xcode 4.3.3 - OS X 10.7) :
Put an NSButton in Interface Builder
Set it to 'Image Only'
Drag'n'drop a system icon (e.g. NSAddTemplate)
But the icon fails to show (while I'm perfectly able to see icons when they're not system icons, but added by me).
Any ideas?
I've just tried, it works in a weird way.
Try to set image and alternate in the NSButton inspector.
Pick the images from the drop-down menu directly instead of drag-dropping it.
It works but it's just a workaround...
Alternate answer: Make sure the image files are included in the Copy Bundle Resources phase for your target (especially if you have multiple targets in your Xcode project). There is no build-time error or warning if you specify an image that is not in your bundle. (There is a runtime warning).

How to change image displayed on image browser?

I want to build an application that when the folder is drag and drop to my app, it will retain path and show custom image. so here is the screen shot of my app.
So as you can see in the screen shot, when i drag and drop folder on my app it will display the folder with the custom frame. So the problem is i want to change the folder icon shown in my app to other picture. I am still new to cocoa programming so i hope anyone can point what code to use to change the folder icon in my app. anyway i am using xcode 3.2 to build my app.
You need to point to a directory that contains images. if you point to a directory that only contains directories, this is what you get.