0

I am developing an app in Xcode, I got it working and was putting some finishing touches. Then I upgraded Xcode to the latest version, changed a bit the code for the Autorotate options (my app shouldn't autorotate) and fiddled with the supported rotation (landscape vs. portait).
Then suddenly my debug in iOs simulator just shows a black screen. The app builds fine but nothing is shown in the simulator....
And I can't really understand why...

Using Xcode 4.6

i don't have an ApplicationDidFinishLoading but I have this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

[window addSubview:viewController.view]; 
[window makeKeyAndVisible]; 
return YES; } 

Antonio
  • 535
  • 10
  • 26
  • Any log you can give ? Try removing the app from the simulator, clean the project and re-run. – rdurand Mar 01 '13 at 10:39
  • Set a breakpoint, somewhere in you're AppDelegate. See how far you come... – fguchelaar Mar 01 '13 at 10:42
  • which is the current version of xcode. and can you please provide the Appdidfinishload code here – Melbourne Mar 01 '13 at 10:43
  • Xcode 4.6 i don't have an ApplicationDidFinishLoading but I have this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add the view controller's view to the window and display. [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } – Antonio Mar 01 '13 at 10:46
  • Allocate the ViewController of your root view! – Kiran Mar 01 '13 at 11:45

2 Answers2

1

Use Below Code instead in your ApplicationDidFinishLoading

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.viewController = [[YourFirstViewController alloc] initWithNibName:@"YourFirstViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

This may solve your problem. Please try it.

Melbourne
  • 531
  • 3
  • 24
  • thanks now something shows in the interface, even it's in portait mode instead of landscape... – Antonio Mar 01 '13 at 10:54
  • i set "initial interface orientation" and "supported interface orientation" both to Landscape (right button) but interface it's not correct – Antonio Mar 01 '13 at 10:55
  • 1
    Some of the rotation methods are deprecated such as shouldAutorotateToInterfaceOrientation .So pls check weather your functions are get called – Melbourne Mar 01 '13 at 10:59
  • THANKS MELBOURNE. commenting the "shouldAutorotateToInterfaceOrientation" solved my problem. THANKS A MILLION !!! – Antonio Mar 01 '13 at 11:03
  • It works under Simulator 6.1, but not in Simulator 5.1 and my iPad which has 5.1...how can i make it work under both iOs (5 and 6)??? – Antonio Mar 01 '13 at 11:38
  • http://stackoverflow.com/questions/12577879/shouldautorotatetointerfaceorientation-is-not-working-in-ios-6 pls refer this one – Melbourne Mar 01 '13 at 11:44
0

commenting the "shouldAutorotateToInterfaceOrientation" solved my problem.

Antonio
  • 535
  • 10
  • 26