app icon not showing in iphone simulator
I have a 57x57 PNG file in the root of my bundle (update: and added to my project), and the "Icon file" setting in my .plist file has the correct filename, but when the app is installed to the si开发者_开发百科mulator, the icon is the default grey/white one.
I've tried deleting my app from the simulator (both through the simulator and through rm -rf on the app directory from the console), I've tried cleaning my target, and I've tried renaming my app icon, all to no avail.
What do I have to do to get the icon showing?
Got it! I added the file to my project, but it was added in association with the wrong target (a unit testing target). I got it associated with my app target and all was well.
Update:
To associate a file with a target, select the file and navigate context menu -> File Info -> Targets
In the File Info dialog under the "Targets" tab, select the target membership desired.
Done.
One thing you didn't say is that you added it to the project. Once it is in your project, not just the directory, it should appear.
Another problem I have had is that some image editors are "helpful" about the file extension. This can lead to an image file named either "icon.png.png" or "icon" depending on which way they go. Check that too.
I also had a problem where one of my images was named "Icon-iPad.png" but was actually a PSD file, Preview and QuickLook ignored the extension and showed it normally. Double-check the format.
精彩评论