Testing universal app on iphone only - iphone

I am developing a universal ios app and the iphone version is nearly done and about 50% of the ipad. However I need to get started testing the iphone version. Therefore I changed the project only to be a iphone target. However when the app is on the ipad, the nib files for the ipad version is loaded in the iphone simulator. Therefore you only see a fraction of the ipad screen in the iphone simulator. One solution is to remove the references to the ipad nib files, however I would like to avoid this approach.
Anyone one with suggestions?
Regards
EDIT: The problem is if I want people to be able to test the iphone version on a ipad(some people only have an ipad not an iphone). When running the iphone simulator on the ipad, it would load the wrong nibfiles. Those intended for the actual ipad and not the iphone.

You don't want to "change the project only to be a iphone target". Change it back and just build and run on the device (iphone or ipad depending upon which one you have plugged in).
Btw, in future I STRONGLY recommend that you test early and test often - e.g. test on devices every day.

Okay, it ended up with the solution I did not want to do :) I removed the nib files intended for the ipad and it removed the issue. After the test I will have to add the ipad nib files to continue working.

Related

Problems with Universal iPhone/ipad app build

I have created a Universal (iPhone/ipad) application .I have created separate Xib designs for iPhone and iPad both works well. When i build the app it should give a single .APP(build).I installed in iPhone and iPad tested correctly.
Now i want to give a two separate builds (for user to test), one for iPhone and another one for iPad.So in project settings i changed a target device family (iPhone/ipad -> into iPhone) and (iPhone/ipad -> into iPad). So it gives two separate builds.One for iPhone and another one for iPad.
My problem is when i build with iPhone(as target device family) and installed in iPad means it loads a iPad design not an iPhone design.What could be the mistake i did here ? I search a lot and could not find any solution.
If any one did like this? or do it for me?(testing)
Thanks in advance.....
It's because (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) if you run iPhone-designed app on iPad. And thats why iPad version of xib file is selected. So you need to attach correct .xib file manually, or exclude iPad version of it from iPhone resources.
The tester can install the same build in both iPhone and iPad. The concept of universal build is that, the same app will work on both iPad and iPhone.

Change app to only iPhone deployment

Im using Xcode 4.1 lion release. My app was rejected because it only works on the iPhone, this is how it should be, but i guess i didnt set my app up so it only works on the iPhone. How would i do so?
I go to Targeted Device Family under my project build settings and i have iPhone selected.
`
What else do i need to do. Thanks
EDIT: During the app review it was still set up under device family as iPhone
Remove and iPad xib files that were created initially. By default Xcode makes an iPad folder when you select the universal build, remove that and you should be good. Other considerations might be to remove iPad launch images if they are present, or any iPad specific code like popover view controllers etc.

App works on iphone simulator,iphone device, ipad simulator but not ipad device

So I made an app, And it runs on all possible platforms except the ipad device. I would understand if it ran on the ipad device and not the iphone device since the processor is better on the ipad, but this has me stumped. It also worked fine on the ipad simulator. Can anyone think of a reason why this could be?
There are too few details to give an explanation. A possibility is: when you run the app in two different devices, iPhone and iPad, some nib files could be different. Even the app delegate is different if you use XCode templates for universal apps. So this means that it is possible that the code executed is different in the two devices.
So imagine that in the iPad app delegate / view controller you're allocating - at launch - a lot of memory (scroll view with many large images for example). Then the app will not crash in the simulator (it uses your Mac memory). The app will not crash in the iPhone (different code). So at the end it will crash in the iPad only.
Other possibilities: you're going short in memory very soon. But the iPad 1 has less memory than iPhone 4G.
Other possibility: the watchdog timer kills your app at launch. It happens on the iPad 1 only because you're loading a few large images and it takes a lot of time, just enough to be killed by the watchdog.
Other possibility: iPad 1 is still with iOS 3.2, while iPhone and simulator are linked to iOS 4.0. In this case it is easy to have the app crashing in iPad 1 by calling one of the many new APIs introduced with iOS 4.
As you can see there are many possible explanations...
add target for device or convert it to universal application
Yes, it's easy to target both platforms. If you login to ADC and read the Programming Guide, it'll provide the basics for specific development. I can't legally speak of the "how."
Um. If you follow their directions, build two targets, share your source within the same project... then you'll be set. It's the same SDK, just different Nibs & main(), from what I can tell.
You say different xibs... you might be missing an Outlet connection somewhere.
Ok gents, sorry but I did not provide enough information for any of you to correctly answer this, but! here was my problem.
I had a login screen with 2 textfields, and a submit button. The submit button would release the current view and add a new view. I would usually press submit while the keyboard is being shown. Aparantly this makes everything blow up. You must manually hide the keyboard first. Hopefully this saves somebody some time.

Universal apps are not working right. Why?

Which part of the app is it that "triggers" the iPad app as it's own app as opposed to running the iPhone version in a universal binary?
What do I need to change to make my app Universal, after clicking "Upgrade current Target for iPad"? My app runs on outside of the simulator, but my images are too small and my text is out of place. What am I missing here?
To the opposite end, how do I force my Universal app to run as an iPhone app inside the simulator on the iPad? (When changing "Target Device Family", it will run the iPad version of the app in the simulator, but not the iPhone version.)
EDIT:
It seems to me that these questions kind of complement each other. While I suspect it's the same mechanism at work in both situations, I'm not sure what it is, or how it works.
There are keys in the info.plist file put there by the Targeted Device Family setting. The iPad looks for those plist keys to determine whether to launch as a Universal app or in iPhone emulation mode, and which idiom's xib files to use for app launch.
Added:
If you don't have, and specify in the plist, a .xib file suitable for the iPad idiom, then one with the wrong UIWindow frame is used, which ends up in the upper left corner.
You need to re-code the app for the iPad to lay out your text and images how you want them when it is running on an iPad.
To make it run as an iPhone app you stop it being Universal.
The build setting is called Target Device Family
That's where it starts.
If you wrote a universal app and you want to force the iPhone mode on the iPad you switch Target Device Family to iPhone only and it will ignore everything else.

Simulator flips to iPhone

I created my first universal app by using the universal app template.
I set up xib files and main view controllers for both iPhone and iPad and the iPhone version runs fine.
Yet even though I change the simulator hardware to iPad/3.2 when I test, the simulator changes back to the iPhone.
Please help.
Dan
I found that if I change the targeted device in the project settings from iPhone/iPad to iPad, I can test. I'll have to change it back when I'm ready to release the product. Who knows if it will work.
Side issue: I found that the new imageWithCGImage:scale:orientation is not supported in 3.2. I have to branch upon the interface idiom.