tags:

views:

82

answers:

2

Never thought I'd get an error in this file when I compiled, but after running my app in debug mode, The app stops and highlights the line

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

in my main.m file as a breakpoint. When I run in normal mode, the app just shows a black screen. What does this mean?

(Update)

Okay, nothing has worked so far. Here is the code that is failing:

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) 
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

The stack says

Pending breakpoint 1 - ""main.m":31" resolved

The weird thing is, I removed the aforementioned view controller that preceded this problem, there are still no warning or errors and I the application still either halts in debug mode or returns a black screen and freezes in normal running mode.

Here is a drop containing two screenshots of my view and window arrangements in my two NIBs in IB. You can also download my full project to browse the code, if you wish. The project is named "iHouse.zip"

http://drop.io/6lhubkb

Otherwise, any other specific code anyone would like to see, I'm happy to paste it here on request. Otherwise, I'm stumped.

Thanks.

A: 

It means you probably forgot to hook up a window or view to load after the application launches. Unless you modified the main.m file (which you shouldn't need to), it should be just fine.

iWasRobbed
I'll see if that's the case, but I doubt it. The main.m file hasn't been modified and this error began after I added another table view controller and corresponding viewcontroller files to my app. I've looked over the code meticulously several times and everything seems to be hooked up correctly. There are also no errors or warnings.Thanks for your help.
ajkochanowicz
Additional information: http://stackoverflow.com/questions/3216336/blank-black-screen-when-running-my-ipad-app/3216476#3216476 ..Feel free to post updates either to your post above or to comments.
iWasRobbed
If it started after adding the tableview controller or other view controller, find out which is causing it (if either even are). Otherwise, possibly post a stripped down version sample project for someone else to look over. It always helps to get a 2nd pair of eyes on a problem since you may be too close to the situation to see even a glaring mistake.
iWasRobbed
Great! I'm sure I'll find the answer there. Thank you.
ajkochanowicz
I have updated the situation above.
ajkochanowicz
A: 

Solved....sort of. The "31" in the stack was oddly referring to a random line in the commented out apple disclaimer in the beginning of main.m. I removed this and that problem went away. Still not sure why it suddenly became a problem in the first place.

I compared the code side-by-side with another app and found that I had commented out a critical part of applicationDidFinishLoading in the AppDelegate as @IWasRobbed had suggested.

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    [window addSubview:splitViewController.view];
    [window makeKeyAndVisible];
}
else
{
    [window addSubview:tabBarController.view];
    [window makeKeyAndVisible];
}

Because I was not ready to make this app universal, I commented this part out. In doing so, I took out the crucial piece to tell the app what the heck to load in the first place

    [window addSubview:tabBarController.view];
    [window makeKeyAndVisible];

Thanks everyone for your help. Took all day to find a silly error on my part, but you live and you learn I guess.

ajkochanowicz
please consider accepting past and present answers so they are marked answered. click your name to goto your profile, click on each question you've asked and then hit the check mark next to the most correct or helpful answer. more info on reputation http://meta.stackoverflow.com/questions/7237/how-does-reputation-work
iWasRobbed