Loading different images for iPhone and iPad - iphone

I have read this post: How to support both iPad and iPhone retina graphics in universal apps and know that all I need to place ~ipad at the back of the name of the image to have it read properly. I have done this.
The problem is that the image appears correctly in the simulator. I can see that it reading the correct image from the size. But same image is appears as the iPhone Version in the device. Not sure why this is happening.
Need some guidance on this...

Every time I've had the proper image in the simulator, and image not showing up on the device, its been the same thing: UpperCase lowerCase mismatch on the name. i.e. You are asking for myPicture of type png, and your file is named MyPicture.png.
The simulator doesn't mind the case difference, but the device won't recognize the improper name.

Related

How to make my iphone app work on an iPad?

It is my understanding (i have seen it) that some apps can be opened and viewed in an iPad. Although, the iPad keeps the screen small, or pixelated if doubled the screen size.
I am attempting to do the same thing with my app, however when I attempt to run it on an iPad it crashes with the error
'Could not find a storyboard named 'MainStoryboard_iPad'
This is obvious, as I do no have a storyboard for the iPad, but currently I don't want one. I just want the iPad to run the app as an iPhone app in a smaller version. So my question is, how do I stop it from looking for the iPad storyboard? Its my understanding I must adjust something in the plist.info but I don't know how to access that in xcode. its my understanding you select the project in the navigator then select 'info' but I don't see any information that people say should be in the plist.info.
Thanks
You seem to have made your application universal. You want to set your "devices" to iPhone. This can be done on the target summary page (No need to interact with your .plist directly).
Only target iPhone platform, and do not call any iPad interface objects in your code. You should look in your Main xib file to make sure there are no references to an iPad interface object.
iPhone only apps should natively run in double-pixel mode. In order to resolve the pixelated / grainy issue you see, use #2x (for iPhone) size images. This will reduce the pixelation you see, but will still contain some.
Ok, I found the final issue. After editing the summary to 'iPhone' I also had to go into the Info tab and change the line that says
'Main storyboard file base name (iPad) to MainStoryboard_iPhone. It was currently set to MainStoryboard_iPad. That second step fixed the issue.
Thanks guys!

Retina images (#2x~ipad) not loaded if iPad image doesn't exist (~ipad)

I have something strange in my app.
If in the ressources I have 2 files named : myFile~ipad.png and myFile#2x~ipad.png the retina image is loaded on iPad retina as it should be.
But If i have two files named myFile.png and myFile#2x~ipad.png, the retina images is never loaded and myFiles.png is used for all devices.
Is this normal ? The problem is that I want to use the image myFile.png for iPhone, iPhone retina and iPad and the image myFile#2x~ipad.png for iPad retina so I can't put the extension ~ipad beyond myFile.png.
Use symlink. I just google it, and didn't say it couldn't be done, but most of it points to symlink in an SD card.
You can have the same image "myFile.png" with different name as myFile~ipad.png so that you can have same result for iPhone, iPhone retina and iPad. And "myFile#2x~ipad.png" image for ipad retina display.
hope this will help.
We tried using symlinks, but it turns out that in the built app, the symlinks actually turned into copies of the images they linked to. Xcode resolves symlinks by copying the source file. So you can use symlinks for convenience, but not to save storage space in the built app.

Convert iPhone project to iPad project?

I'm just starting out with iOS development and I'm actually trying to make an iPad application. I've found a sample project that is perfect for me to start from but it's meant as an iPhone app.
So I was wondering, maybe it's just a matter of replacing some xml file to convert it into an iPad app?
Any ideas if it can be done, and how?
If you are using Xcode 4, select the application target and change the value of Devices in the Summary tab to iPad.
You should also modify the appropriate xib files made for iPhone. You may also have to change any code that works only for the iPhone like specifying frames with fixes values that fit the iPhone screen size, but are too small for the iPad screen size.

iphone application splash image looks blurry on (iPhone 4) device

I have an Default#2x PNG image (640x920) for splash screen of our iPhone app. For some reason, it looks blurry on the device (iPhone 4) where the app is deployed, but instead on emulator it looks just fine. We are using XCode 4.2 for development. Any reasons why that's happening? And also, we assume that the image size of 640x920 should be fine (to not including the status bar - 40px in high res), correct?
Try to clean the build - an old Default.png may be used instead of the newer one. If that doesn't work, it might help to see the image used.
Also, as #barley said, check that the file name is Default#2x.png, as it is case-sensitive.
The size of Default.png and Default#2x.png should be 320x480 and 640x960, the entire screen. This is probably because Apple allows apps to remove the status-bar at startup, but can also have resizing-effects (not sure about that).
Make sure that the file name matches exactly Default#2x.png including the case. The device is case sensitive although the simulator is not.
The math of the resolution seems correct, but since the doc says 640x960, it is also a suspicious point.

iPhone 4 apps automatically scale up on iPad?

I thought I read/saw/heard something saying that apps built for iPhone 4's Retina Display would automatically run at 640x960 when installed on an iPad. However, can't find any documentation on that specific feature, and my app still runs at 320x480 when installed on an iPad.
Is there a step I've missed to make this happen? Or did I just imagine this being a feature?
Apps do not auto-upscale, BUT if you have an image larger than the UIImageView you are placing it in, you will get as large a version as the iPad can draw.
I don't think it knows to pull in #2x images, just ones that are actually larger than the space you are placing them into.
This is not the case; currently, apps won't auto-upscale on an iPad. Perhaps Apple will add this in iOS 4.x for iPad, but certainly there's been no indication from them that they will.