0

I updated to iOS 8.3 and suddenly the Simulator I'm using to debug my XCode/GLES app (iPad 2) is having trouble responding to mouse clicks in the rightmost portion of the screen.

Our application's delegate class name points it to our AppDelegate which derives from UIViewController. Inside the AppDelegate's applicationDidFinishLaunching we then start creating windows - the top-level window being a UIWindow with its main child being a GLView. The application runs in landscape orientation.

Some (possibly important) pieces of code:

Info.plist:
  Supported interface orientations
    Item 0: Landscape (right home button)

int main(int argc, char *argv[])  // In main.m
{
  int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([MyAppDelegate class]));
}

@interface MyAppDelegate : UIViewController<UIApplicationDelegate>
{
  ...
}

@implementation MyAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
  [[UIApplication sharedApplication] setStatusBarHidden:YES]];
  [[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;

  CGRect boundingRectangle = CGRectMake(0, 0, 768, 1024);
  uIWindow = [[UiWindow alloc] initWithFrame:boundingRectangle];
  uIWindow.rootViewController = self;  // <-- Added this
  [uIWindow setTransform:CGAffineTransformMakeRotation(DegreesToRadians(-90))];  // <-- Added this

  boundingRectangle = CGRectMake(0, 260.0, 800, 480);
  glViewWindow = [[GLView alloc] initWithFrame:boundingRectangle];
  [uiWindow addSubView:glViewWindow];
  [uiWindow makeKeyAndVisible];
}
@end

From other stack overflow discussions, it appears the problem is related to the warning we always get "Application windows are expected to have a root view controller at the end of application launch". So we added the line " uIWindow.rootViewController = self;".

This causes the application to be rotated 90 degrees. The simulator is correctly in landscape mode, but the application is in portrait. So we added the "setTransform" line seen above. That rotated the window into the right orientation, but (1) it's offset down and to the left, and (2) none of the mouse clicks work at all anymore (completely unresponsive).

Any ideas on what might be happening here? What can we try next?

Betty Crokker
  • 3,001
  • 6
  • 34
  • 68

0 Answers0