I'm building an app using the ImageTarget native iOS sample app as the base code. I've set the orientation for both iOS5 and iOS6 to support only landscape, and the display rotates correctly in both iOS5 and iOS6. I'm programmatically creating UIKit UI objects in the OverlayView without a problem.
In fact, the entire app is running as expected, with the exception of touch events when the app is first launched.
Upon first launching the app on an iPad, holding the app in either landscape orientation, touch events only occur as if the device was in Portrait orientation. Any touches in the range beyond the Portrait width are ignored until I physically rotate the device into the opposite landscape orientation. At this point, touch events occur as would be expected in landscape, and continue to occur correctly even after I rotate the device back to the original orientation.
This behaviour occurs regardless of the starting Landscape orientation, either left or right, when the app is first launched.
"handleARViewRotation:(UIInterfaceOrientation)interfaceOrientation" in ARViewController.mm is called on launch with the correct landscape orientation.
Have I missed a spot in the code where the launch orientation has been defined to Portrait?
Thanks for your help,
Jorge
Stuck in Portrait until device is physically rotated
I have fixed the problem with what seems to me to be a hack.
I added the following two lines of code to "viewDidAppear:(BOOL)animated" in ARParentViewController.mm.
Stuck in Portrait until device is physically rotated
Good to hear you solved the problem.
Orientation support changed in iOS6, and i think it is defined in the plist for the project - you should be able to set the initial orientation by selecting it after selecting the target.
Stuck in Portrait until device is physically rotated
Thank you for the response, NalinS. Yes, even though I set the supported orientations in the plist, the problem occured until I applied the fix.
But now I've encountered a new problem that is iOS5 specific, related to Game Center.
Stuck in Portrait until device is physically rotated
Not really sure what to suggest here.
Just wondered whether you have experimented with bringing up Game Center from ARParentViewController instead?
N