Pradip
Pradip

Reputation: 1537

App wont start using testflight on iOS6

I have an application that I want to test it on iOS device. The application uses NIB files and no story board.

Target framework is set to - 5.1 Device - Universal.

I have created the IPA file and uploaded to TestFlightApp.

I have downloaded and installed the application on my iPad. Weird thing is when I tap on the icon a black screen shows and nothing else happens.

I have done the following settings.

Main Interface - SSDMainViewController Main Storyboard - Not set as I don't have any storyboard in the applicaion.

It is not the problem of IOS versions as other apps are working fine.

EDIT : When I double click the iPad button I saw that the application is not crashing. It is running in the background.

EDIT 2 : More information on the question.

Well I have taken a view based application and it has all NIBs no storyboard. It was initially an iPhone application targeting the IOS 5.1 but then I have changed the value from the project drop down to UNIVERSAL. But that I think is no problem because when I installed it in my iPad it showed me nothing. Also it showed black screen with the iPhone frame and then nothing. The application is still live in the thread.

What bothers me is that I have done this in the AppDelegate :

I have set the

self.mainViewController = [[SSDMainViewController alloc] initwithnibname:@"SSDMainViewController" bundle:nil];

And then I have set the navigation controller and then pushed the view to it.

I FOUND SOME MORE INFORMATION

In the console it says.

The application is expected to have its root view set at the end of application start.

MY APP DELEGATE

ftipValue=0.25;

cardtype = @"American Express";
[cardtype retain];

[self CallFunctionForLogout];

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Create an instance of YourViewController

//SSDMainViewController *yourViewController = [[SSDMainViewController alloc] init];
self.mainViewController = [[[SSDMainViewController alloc] initWithNibName:@"SSDMainViewController" bundle:nil] autorelease];



// Create an instance of a UINavigationController

// its stack contains only yourViewController

UINavigationController *navController = [[UINavigationController alloc]

                                                  initWithRootViewController:self.mainViewController];

navController.navigationBarHidden = YES;

// Place navigation controller's view in the window hierarchy

[[self window] setRootViewController:navController];

[self.window makeKeyAndVisible];

return YES;

Upvotes: 2

Views: 1458

Answers (3)

Himanshu padia
Himanshu padia

Reputation: 7712

Please use two xib file, universal app we want two xib (nib)

  • one for iPhone - ViewController_iPhone
  • second for for iPad - ViewController_iPad

Add following code to your AppDelegate.m file.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
        // Override point for customization after application launch.
       if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
       {
           self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
        } 
       else {
           self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
        }
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
        return YES;
    }

I have done this and it's work fine for me.

Upvotes: 4

Matt Mc
Matt Mc

Reputation: 9297

If you are getting "The application is expected to have its root view set at the end of application start." there are a number of possibilities. Clearly, that is the problem, since you have a black screen with nothing in it...

Check out this SO question: Application windows are expected to have a root view controller at the end of application launch warning Rob Mayoff has a good description of what should be happening when your application initializes.

Also, linked to in the above post, is this post wherein there are an additional 35 answers with various scenarios of what could be happening.

Beyond browsing through those links, you will need to post up additional code and/or descriptions of how your nibs are wired up for anyone to help you--as evidenced by the myriad ways it is possible to cripple the initialization sequence.

Upvotes: 2

jrturton
jrturton

Reputation: 119242

That error means that you're not setting up your application correctly.

You say you've set SSDMainController as the main interface file - is this both for iPhone and iPad? There are two sets of entries in that section of the summary tab for universal apps.

I would expect a different xib file to be specified for the iPad, since a different sized view and different layout would be in use.

You have either not set the iPad xib, so the app can't set up a window with root view controller, or you haven't set up a valid iPad xib, so it isn't loading at all, with the same results.

If you just want the app to run in the mini-iPhone window with the 2x button, leave it as an iPhone only app.

Upvotes: 3

Related Questions