Image on UIbutton visible on simulator but lost on device - iphone

I have made an application which includes movie player in it. Video starts playing on touching PLAY button. I have set an image "Play.png" on button and while running on simulator Image shows up but on device image does not show up.. Well I checked application on iOS 4.3 simulator and installed it on device iOS 3.2. Is it because of older version ?
Thanks..

I don't think OS version matters. Just check the case of your image name and the one you are using.
Once it happened to me because of wrong case of the image name. My image name was "portraitbackground.png" and I was writing "PortraitBackground.png". Remember the simulator is running on mac os not iOS. Anyway, just check the case and write exactly what the image name is. I think .png and .PNG would also be treated as different but I haven't experienced it.

I meet an issue like this problem but a little different.
My Xcode version is 9.3. I import a third foundation in my project. In the foundation, all images are in bundle. In order to adapt my UI,I replace some pictures in the bundle,that use the same name.
But in recent days ,the foundation is update. on the last version , images name used capital letters。And On the newest version ,images name used lowercase。After update,replace images and rename images,I find that the images that renamed visible on simulator but lost on device.
After keep trying, i found that the problem was Xcode's bug. Because I rename images in Xcode just like 1.
How I rename images is in Xcode
So I rename images in finder and Shift + Command + K.

Related

iOS Launch Screen Asset Catalog not working

I believe I am making a silly mistake. But I cannot figure it out.
I have an image named Default.png that I have added to my project. Now when I go to General and then Launch Images I drag and drop this Default.png to the 2x window for my app. When I go to build the project and try it, I get this error:
"The launch image set named "LaunchImage" did not have any applicable content."
What's the problem here? I've also seen that simply dragging and dropping the Default.png should do it, but I think that's for older versions.
Any ideas?
Thanks
Search for LaunchImage keyword in your .plist file and delete it. Then, try assigning the image again by dragging as you already did before...
This case raised in Xcode 5.0 + iOS 7.
Apple use Images.xcassets to group App Icons, App Launch (Default) Images in Xcode 5.0 + iOS 7.
For solving the problem of Asset Catalog Compiler Error
The launch image set named "LaunchImage" did not have any applicable content.
Approach:
Putting suitable size of images into LaunchImage.
For example:
Should be 640x960 dimensioning in iPhone Portrait iOS7 2x.
Should be 640x1136 dimensioning in iPhone Portrait iOS 7 R2.
Reference from iOS App Programming Guide:
Create and Set iOS Launch Images
Launch images are displayed while your app is launching on iOS. A launch image matching the device resolution appears as soon as the user taps your app icon.
App Launch (Default) Images
Specify the launch images for your app in your Xcode project settings. In Xcode 5.0, specify these images on the General tab of your project settings; in older versions of Xcode, this tab may have a different name. Xcode places your launch image files at the top-level of the app bundle and configures other project settings as appropriate. Specifically, Xcode adds the UILaunchImages key to your app’s Info.plist file automatically if your app runs on iOS 7 or later. That key tells the system the name of your app’s launch image files. For earlier versions of iOS, the system uses the launch image filenames to decide which image to load.
The same error has been resolved by adding the exact sizes of launch images for different iOS devices.
I tried everything here, deleted the .app and rebuilt each time, and nothing worked. I finally got fed up and switched back to the old style of launcher image specification (Project Settings Window -> General -> Launch Images -> Source -> Don't use asset catalogs.) That worked!
I had this problem as well. Make sure of a couple of things:
Aspect Ratio is what Apple expects, in other words square
The sizes are correct, 60pt (for example) should be 60x60
60pt #2x should be 120x120
After I fixed the sizes the app compiled without errors but I think the most important thing is the aspect ratio.
In my case, with Xcode 7, the Images.xcassets was missing from the Build Phases, under Copy Bundle Resources. Then I just added it manually and the problem was gone.
Try looking at the code for "LaunchImage" and rename it to "Default"
Check and compare carefully if your image size matches the expected size. In my case I was using a wrong size, but when correcting the project built fine.
Check this attached image to see where you can compare them

Completely weird font rendering on iPhone

I have a custom font embedded in my iPhone app that previously has rendered perfectly (both in the simulator and on the device). Today though, when I built and ran the app on the device it suddenly looked like this:
The problem only exists when running on the physical device. I have never seen this phenomenon before; what exactly is it? The other fonts that are used in the app render perfectly as before.
I think the font file which you include is corrupted by Xcode please delete the existing one and move to trash also and import new font file. Sorry for my english.
Its weird but I am guessing that the font files may be compressed wrongly by xcode. Check if xcode adds compression to font files as it does with image files. disable it and try to see if that solves the problem.

App Icon not changing when app version is updated in iOS 5 simulator

I recently started using Xcode 4.2 and the iOS 5 simulator. When I update an older version of my app pre-installed in the simulator, it updates the app just fine but the app icon is not updated. Even with cleaning and building the app ahead of time (sometimes a couple of times) this seems to be the case. Is this a bug or am I doing something wrong?
EDIT: Still the same problem, but when I quit the simulator and start it again (NOT deleting the app), the icon is updated. That's a little encouraging at least. Has anyone else experienced this?
I've had this problem for a while and cleaning the project didn't work either. I finally found a trick to do this. It works at least in iOS 6, I'm not sure in previous versions. The trick is to simply move the app to a folder. The moment you move it there it should display the new icon, and then you can move it out again.
Despite others' answers, it would appear that your problem is a bug.
It would probably be wise to report this. Otherwise, try making a new project and trying again.
Hope all goes as planned.
Theres a new category in the plist file called Icons Files (iOS 5.0). Try adding those file names to your target info like so:
In this tab:
The names and size much also be exact. See this Apple Technical Q&A #1686:
57x57 - Icon.png
114x114 - Icon#2x.png
72x72 - Icon-72.png
50x50 - Icon-Small-50.png
29x29 - Icon-Small.png
58x58 - Icon-Small#2x.png
I ran into a similar problem after renaming the app and adding the Icon files category as described in one of the other answers. No icon would show up in either simulator or device. Tried a clean build as well as restarting simulator and Xcode, no success
The solution for me was to drag the icons from my Resources to the two empty wells under App Icons located under Targets -> Summary. After that my icons showed up in both simulator and device. I´m running Xcode 4.3.1
this works for me.
In iOS Simulator :
iOS Simulator -> Reset Content and Settings
Be aware that it removes all things from the simulator to the trash... but it does work.
Make sure of icons sizes are right at the Image Asset folder

iOS SDK 4.1 UIImageView differences?

I just upgraded to iOS 4.1 SDK and now when I run my app in the simulator one of the images (the only one really) that was working fine before the upgrade is no longer showing up in my view. I've tried removing the file and re-adding it to the project, cleaning all targets and running a build, and making changes to the XIB where the UIImageView is configured to for it to recompile it, but no dice. It's worth noting that my Tab-Bar images came through just fine. Any ideas?
If the UIImageView is created inside a .xib, open it up in Interface Builder: can you see the image in the "preview"? If not, then it can't find the image to begin with. Perhaps the file has been renamed?
Look inside the application bundle in the Finder. Is your image file present? If not, is it still referenced in your project? Check Xcode to make sure the file name isn't in red (i.e. missing).
Maybe they've changed the 4.1 simulator to be (or rather, pretend that the filesystem is) case-sensitive?
Does the app work on a 4.0 device?

iPhone Splash: "Default.png" displays on simulator but not the iPhone

I'm trying to give my iPhone a splash screen.
I've placed Default.png in my resources group. When I run the simulator it is displayed as expected, however when I install my application to the iPhone, no splash screen is displayed.
Does anyone know what the cause/solution to this problem is?
Thanks!
If Default.png is not showing up in device, but simulator... then try the following.
Be sure you delete any "default.png", "Default.png", "Default.PNG", etc. that you might have created in several wrong attemps from within XCode and in Finder.
Delete the App on your iPhone/iPod/iPad
In Xcode Build->Clean All Targets
In Finder go to your project and locate the build folder, delete all folders in there.
Create a new Default.png like in the following example:
Connect iPhone/iPod to Mac.
Start your App on iPhone
In XCode launch Organizer (Window->Organizer)
Select your connected Device
You should see a tab "Screenshots"
Push the Capture Button, to make a Screenshot of your App
Push "As Default Image..." Button (This will create the Default.png and add it to your project, so that's a really handy thing)
Build and Run again. It should work now
Problems can occur due to wrong format (should be 320 width and 480 height (yes, that means you can see the status bar in your default.png)) or because you might have named the first file default.png (WHICH IS WRONG), which worked in simulator because it seems to be case insensitive but then when it gets copied to iPhone, it won't be found, cause it is case sensitive. So it will still be there in build folder (i think) causing a next correctly named Default.png not to override the old default.png in this iPhone build folder and so it might seem, that you can't fix the problem (cause you see Default.png in project, but in build it's still default.png).
At least this is my understanding now (afterwards), since for me it simply didn't want to work even though I tried again and again with different solutions from other people.
So from my point of view this different file handling (case/not case sensitive) is a mess that you can solve, by simply cleaning all and everything and trying to generate a new Default.png with the organizer (after everything was cleaned).
If you want a different/modified splash screen. Open the generated Default.png with photoshop/gimp/whatever and edit it.
Make sure your image is 480x320 pixels, and placed in your application at the top level. The frameworks will display this image until your initial view has loaded and is ready for display.
If you are seeing a black background then there is something amiss, however if you are just seeing your app's initial view then be happy you have managed to launch your app and have it ready for use in good time.
If you really, really want the user to to see your splash screen then slow down your launch by adding a delay into your app before you present the initial view
The file name must be Default.png (with a capital D). Also, do a clean/rebuild of the entire project to ensure the most recent version of the file is being included in the project. Check the filename on the filesystem, it may display differently in XCode.
Make sure that is is added into the bundle. To do this, select the image in the XCode left navigation panel, get info on the file, and make sure the checkbox for your target is enabled. Also make sure the file is really a png and not just named that way.
Just check the spelling ... I think u r using "default.png" instead of "Default.png". just make "d" capital "D" of Default.png .
Another possible issue that is Default.png is actually Default.jpg that was renamed to .png.
This will work fine on the simulator, but won't work on the device.
If you are using an iphone 4 you also need to add a
Default#2x.png with the size 640*960 px.
That's what fixed it for me.
This naming convention applies to all images in your app btw.
I had a similar problem, but my images were being displayed as gray or gray bars. It turned out that there was an alpha channel on the PNG images that the simulator was having no problem with, but the iphone wouldn't display. I opened the images in preview on my Mac and re-saved them without the alpha channel and everything worked. Don't know if this is your problem, but it might be worth a try.
I know this is old, but I'm having the exact same issue. The image doesn't show on the device, but is fine on the simulator. I noticed a lot of really weird things with my project, like there were 3-4 "Default.png" images in my plist and that there were a few other "Default.png" images in different libraries and stuff that I didn't notice.
I tried everything to get them to show up, but after creating a new project and setting the launch images to the EXACT same images I was trying to use, they worked fine. The only thing I can think is that somewhere the project gets corrupted and won't figure out what those launch images do.
Had the same problem caused by saving the initial file as default.png, so it should be Default.png (normal) and Default#2x.png (retina) images.
Go to your projects plist and add a row "Launch image" - use a different file name. Save your images with this name (and add #2x.png for retina). Should be fine afterwards.
Also, if you've already install the app on device, delete the app from device (as previous installation may not affect the changes).