2

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;
deleted_user
  • 3,817
  • 1
  • 18
  • 27
Pradip
  • 1,507
  • 11
  • 28
  • Are you getting any errors in your console log? – propstm Oct 24 '12 at 12:59
  • How to check that ? On ipad you are saying ? I have not checked that. On simulator there is no error. – Pradip Oct 24 '12 at 13:07
  • In Xcode under View -> Debug Area -> Activate Console – propstm Oct 24 '12 at 13:10
  • Ohh you mean in the Xcode.. no there is no problem with the development part. I have already created the IPA file and uploaded it to testflight and installed it in my ipad that is where the problem occurs. I am sure there is something minute that I am missing. – Pradip Oct 24 '12 at 13:15
  • I'm not very familiar with testflight, but I'd recommend checking your testflight logs. This SO post may be helpful. http://stackoverflow.com/questions/10317426/where-can-i-see-tflog-output-on-testflightapp-com – propstm Oct 24 '12 at 13:20
  • Test flight is just a way to publish the app on the fly. Thanks for trying anyways. – Pradip Oct 24 '12 at 13:26
  • If you open Xcode's Organizer window with your iPad attached, you should be able to view its own console messages in the Devices tab. – Phillip Mills Oct 24 '12 at 15:35
  • @Phillip. Thanks mate. But it is not crashing as I have added TestFlightApi and checked the Crash log. There is zero crash log as there is no crash in the application. – Pradip Oct 24 '12 at 17:23
  • Console messages aren't the same as a crash. Sometimes they report things like too long to activate, or a missing file, or.... There may be nothing there that helps but it's worth a look. – Phillip Mills Oct 24 '12 at 17:50
  • yea Exactly.. let me check that.. and I will post anything significant.. but still I dont understand why this is happening.. – Pradip Oct 24 '12 at 18:35
  • @PhillipMills, this is what I got. The application is expected to have its root view set at the end of application start. – Pradip Oct 28 '12 at 07:06
  • please post your appdelegate didfinish method – Hiren Oct 29 '12 at 04:51

3 Answers3

4

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Himanshu padia
  • 7,428
  • 1
  • 47
  • 45
  • This did not helped sorry. I have solved my problem by going around the problem. I have remade the app with Single View type application it is working now. Earlier it was a Utility based flip view app that had some setting I was not sure. Thanks for trying though. – Pradip Nov 01 '12 at 21:23
3

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.

jrturton
  • 118,105
  • 32
  • 252
  • 268
  • can you please elaborate the 1st point. What did you mean when you said set the delegate's window properly. – Pradip Oct 28 '12 at 07:18
  • btw, I have set the delegate to use SSDMainViewController. I will post the sample code tomorrow when I get a hold of the MAC. Its at work. – Pradip Oct 28 '12 at 07:19
  • sorry to comment so fast. I think your answer might help. I will check it tomorrow @jrturton. – Pradip Oct 28 '12 at 07:20
  • The app delegate has a property called `window`. Usually you set this by a line like (typing on the phone!) `self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];` – jrturton Oct 28 '12 at 07:21
  • we have to write this in the appdelegate.m ? – Pradip Oct 28 '12 at 07:27
  • Sorry I misread your question. I thought you said you didn't have a main interface or main storyboard selected, but you in fact have SSDMainController set as the main interface? Check this is set for iPhone and iPad, and that you have an iPad version of the xib set up. – jrturton Oct 28 '12 at 07:33
  • Now here is the point. 1. I have a main interface. 2. When I delete everything on the function of the app delegate, and return yes and create an empty storyboard and set it to the main storyboard the application doesnot crash – Pradip Oct 28 '12 at 07:35
  • Again one more point. The application doesnot have storyboards. Meaning I have not taken any storyboard for the app I have taken all NIBs.. The type of the application is view based application. All the points that you just mentioned are done in the appdelegate. – Pradip Oct 28 '12 at 07:38
  • See updated answer. It isn't crashing, anyway. It just has nothing to show you. There isn't going to be much more to say until you've got the project in front of you again. – jrturton Oct 28 '12 at 07:38
  • That is right. Lets talk tomorrow. Thanks for your help jrturton. You get a vote up for helping. – Pradip Oct 28 '12 at 07:39
  • Can you check this link. I think this will be the answer to my question. http://stackoverflow.com/questions/11515818/application-windows-are-expected-to-have-a-root-view-controller-at-the-end-of-ap – Pradip Oct 28 '12 at 07:52
  • My application was a utility based app. That had a flip view. and a main view. The setting had something messed up so I couldnot get a hold of the problem. Nothing was working. I had to create another project with single view based app. then add everything to the project. This worked. Thanks for trying man. :) – Pradip Nov 01 '12 at 21:25
2

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.

Community
  • 1
  • 1
Matt Mc
  • 8,882
  • 6
  • 53
  • 89
  • thanks I will post the app delegate code once I get a hold of Mac machine. Its at work. I checked the 1st link that you have posted and I think the problem lies in the second point. But again I need to check it with the app first. I will keep you posted if anything luks green. – Pradip Oct 28 '12 at 21:43
  • I tried all the points mentioned in the link. It didnot helped. Appreciate your help though. – Pradip Nov 01 '12 at 21:27