Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MickeyT

macrumors member
Original poster
Apr 26, 2010
92
0
Newcastle, United Kingdom
I deployed an app to my phone for the first time last night. I picked a relatively simple app that I made a long time ago from a book. It was therefore done before the iPhone 5 and the larger screen (which I thought I'd mention in case it is relevant).

I deployed it and it ran absolutely fine. However, it had no app icon. I decided to use the first image in a batch of 20 images that are used in the app as the app icon just so I could see what it looked like on my phone. For reference, when the app launches, it looks the image in thumbnail 1.

I opened the image from a Finder window and changed its size in Preview to 114 x 114 pixels. I saved this via the Duplicate option as a new image and then added the new image to my project and assigned it to the Retina display app icon slot.

However, I forgot to then undo the changes I had made to the original image before deploying the app to my phone. On launching on my phone, the app looked like thumbnail 2.

I undid the changes, resaved the image, and even deleted the image from the project and re-added it. This image and the other 19 are all listed as being 320 x 320 in the inspector, and the app shows up as normal in the simulator. However, I cannot get the app to show the rabbit at the correct size on my phone. I have deleted the app from my phone and redeployed it after checking that the affected image is definitely the same resolution as the others, but it still shows up bigger. All subsequent frames of the rabbit show up on my phone absolutely fine (thumbnail 3).

For information, this was a simple exercise in a book where 20 images are added to a UIImageView and animated so that the rabbit jumps up and down and does a somersault.

Does anyone have any idea why the image shows up the way it does, even when it runs fine in the simulator?

Please let me know if you need more information.

Thank you.
 

Attachments

  • Screen Shot 2013-01-04 at 17.49.24.png
    Screen Shot 2013-01-04 at 17.49.24.png
    104.1 KB · Views: 100
  • iPhone screenshot.png
    iPhone screenshot.png
    115.7 KB · Views: 94
  • iPhone pic2.png
    iPhone pic2.png
    82.9 KB · Views: 76
Last edited:

KoolStar

macrumors demi-god
Oct 16, 2006
825
9
Kentucky
Try cleaning the project before deploying to the device. Sometimes assets are not updated on a normal compilation.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
That worked - thank you very much.

Out of interest, what does cleaning actually do?

Normally when you build, it only builds files that you changed directly in Xcode... it has cached copies of files that you didn't change in Xcode. So if you modify a resource outside of Xcode, it won't reflect that when you build unless you also clean (it's to save time.)

At least that's my understanding.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
There are unfortunately some cases where Xcode keeps old resource files that you've removed from the project or target. Get in the habit of option-clean when you change resource files. Sometimes you will also have to remove the app from the device or Sim.
 

KoolStar

macrumors demi-god
Oct 16, 2006
825
9
Kentucky
Sorry for the long delay in response. The shortcut is CMD+OPT+K to clean and its a necessity on all my builds almost every time resources or classes change.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.