Iphone app doesn't respond after starting in landscape - iphone

I've got a very strange behavior in my iPhone app.
The app should run in any orientation. Plist keys are all set and shouldAutorotateToInterfaceOrientation always returns YES.
Also, it's an iPhone only app, but at this moment I can test it only on the iPad.
Now, when I start it in portrait mode, everything works fine. However, if it launches in landscape mode, the view doesn't receive any touch input, buttons and gestures simply don't work. This is happening as long as the window remains unaltered. If I rotate the app and then rotate it back to landscape, it works. Moreover, if I press the "2x" button on the iPad, the app also starts to work normally.
I've checked all view frames and everything is drawn correctly.
When run in simulator, it ignores the initial orientation and draws itself in portrait mode.
What can be the reason and how to solve it?

I have found that this is unique to iOS 6 (you'll see this on iPads running iOS 6 and even the iOS 6 iPad simulator, but not devices/simulator running iOS 5). If you remove all of the entries under "Supported interface orientation" in the app's plist, this problem seems to go away. Alternatively, if you check the "Hide during application launch" option for the "Status Bar" settings on the Summary screen of the Target settings, this also fixes it:
It makes no sense why either of these should fix the bug, but they appear to.
If you use the "Supported Orientations" tweak, in iOS 6, you can still programmatically control the permitted interface orientations via supportedInterfaceOrientations (in iOS 5, you can still useshouldAutorotateToInterfaceOrientation:).

Related

Iphone resolution on an Ipad

We have an app that has been rejected in the review process by the Apple app review people. The cause for the rejection is that the app is not scaling properly when run on an Ipad.
The app was never meant to be run on an Ipad, but there seems to be no point in arguing with them about that.
Apple sent us a couple of screenshots that show our app being run on an Ipad with the top portion of the view cut off. Notice how the app is run in some mode where it looks like an Iphone app and does not fill out the entire display area. When we bring up the app on an Ipad, it fills out the screen and does so without any edges cut off.
Can anyone please tell me how to run the app on an Ipad the way the Apple guys have - Iphone-sized? We believe we have a fix for the issue but we need to reproduce the error and then be able to verify that the fix solves the issue.
(the logotypes in the images are intentionally blurred)
I just went through this myself and here is how I resolved it:
Go into info.plist and see if any of the supported interface orientations are set for iPad. Despite selecting iPhone only, I had iPad supported orientations for four (portrait, portrait upside down, landscape left, landscape right). I deleted those.
I also deleted any reference to the launch screen in the info.plist. My app is pretty simple and there's no preloading of data so I don't really need a launch screen. If you do, you could go old school and make your first VC the launch screen.
I then made these changes in Target-->General-->App Icons and Launch Images
That was the only way I could get it in the sim to run the app at iPhone resolution while running an iPad (iPad2, iPad Air).
If Apple is going to force developers to ensure an app runs on an iPad even if it is made just for iPhone, they should eliminate the iPhone Only and Universal options and just have iPad Only as an option.
To run an iPhone app on an iPad, you just need to:
Acquire an iPad (you can also use the simulator)
Set the target device family in Xcode (it's under your target) to iPhone
Connect your iPad, perform any necessary certificate dances
Run the app on the iPad.
As long as the target device family is set to iPhone, the iPad will show your app in this mode.
Apple is likely running your app on a simulator, not on a real device. Notice the "2X" on the top right. In XCode - you should run the app on iPad Retina Simulator. On the bottom right you will see a button that you can toggle from 1X to 2X.
If you place the simulator in "2X" mode, you will see what Apple is seeing.
What OS are you running on your iPad? Things have changed in iOS 8 - and that's likely why you're not seeing what Apple is seeing. My guess is that your are running an app that was initially developed for iOS 7 or earlier - which means that you need to upgrade from scaled resolution to native resolutions to resolve this issue. Here is how you do it:
How to enable native resolution for apps on iPhone 6 and 6 Plus?

iPhone app - initial unresponsiveness on iOS 6 on iPad

I have an iPhone app that runs fine on iPhones (tested on iOS 6 and iOS 5), and iPads running iOS 5. However, on an iOS 6 iPad, the app is initially unresponsive until resized from 1x to 2x mode (or vice versa), or an orientation change.
This appears to be a bug in the Operating System, since an app isn't supposed to be able to react to changes to the 1x or 2x mode, but it's still baffling. Any ideas?
I also see this issue on my apps. I found a solution: In the Xcode project -> Targets -> Summary, scroll down to 'Status Bar', check the box for 'Visibility' 'Hide during application launch'. After doing this, the iPhone app works again on iPad iOS 6.
You may notice that after the change the status bar is hidden. You can re-enable it in code with:
[application setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
PaiGow's fix worked for me, but in the iPad Retina sim with iOS 6, views pinned to the top edge of my (Landscape-only) screen moved up into status bar space and were cropped by the dummy status bar than the iPhone "display" on iPad uses.
Instead, I left "Hide during application launch" UNchecked, but still used the line:
[application setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
in my app delegate's applicationDidBecomeActive call.
Just making this call to setStatusBarHidden:withAnimation: is enough to make the app responsive again, in both the sim and on an actual device, and it has no visual side effects that I can see.
I've also tried putting the call in application:didFinishLaunchingWithOptions: and it works in the sim; haven't heard back from my beta tester with the iPad yet as to whether it works just as well in hardware.

Portrait vs Landscape Launch Images

An iPad app can support inclusion of launch images in both orientations; presumably, if your app supports auto-rotation, then this would suggest to me that if the user launches an app while the device is in Landscape mode, then the Landscape launch image is used.
But in all the apps I've built and released, this has never been the case. Never once has the Landscape launch image appeared, only the Portrait. After loading, the app will auto-rotate to whatever orientation the device is in, but at launch, it assumes you are in Portrait. Always.
Why?
I have seen many other apps in the store that behave this way, but then there are some seem to always automatically know immediately at first launch, from that first launch image, that you are in Landscape, if that's the case.
How is this done?
iPhone supports only portrait images (http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5)
Apps that don't support portrait orientations, provide the same portrait oriented image. For example, Angry birds on iPhone has the same portrait oriented image but the guys painted rotated graphics on it.
As it would turn out, the issue was due to leaving out the supported orientations in the plist file for the app. You can add these manually or just select them in the Target page. More details here:
How to get a landscape launch image to actually appear when launched?

Launch image displayed upside down on iPad.

I wonder if you have any idea of why my Launch image get displayed upside down when using the iPhone application/storyboard on the iPad simulator. After the launch image the orientation is correct.
Running on iPad device also has the correct orientation. It is only the when running iPhone application on iPad it does not work. iPhone all works fine.
Any ideas?
I had the same problem today without having changed the UISupportedOrientation-key (my app supports all 4 orientations) while I was changing values in the summary view (Xcode 4.2). The app started to do strange behaviours while loading the launch image, it changed the orientation to upsideDown. I solved the problem by just by changing the sequence of the 4 different orientation levels. 1st element was somehow PortraitUpsideDown and the 4th element Portrait, I swapped these two values and then it was working smooth again.

TV out window in iPad simulator disappears on landscape mode

I'm making an app for the iPad with TV output to an extra screen. Everything works fine, but for some reason the TV out window disappears when I put the iPad in landscape mode. I commented all the code that makes it go to landscape automatically but as soon as I rotate in iPhone simulator, the tv output window goes away.
Is it just not possible to have the device in landscape mode with an extra screen or is there something I'm overlooking?
Thanks in advance.
I've noticed there's a CALayer use-after-release bug in iOS7.0.3 simulator when you have setup an External Screen triggering at some point, but a later iOS7.1 fixes that. Can you confirm if you have the problem with iOS 7.1 ?