Se espera que las aplicaciones tengan un controlador de vista raíz al final del inicio de la aplicación wait_fences: no se pudo recibir la respuesta: 10004003

when i launch my application in iphone emulator, it goes without any problem. If i launch on device it will crash as still as i open it. But when i launch emulator it says that problem:

Applications are expected to have a root view controller at the end of application launch
wait_fences: failed to receive reply: 10004003

What can i do? This is my application delegate:

.h:

#import <UIKit/UIKit.h>

@class TrovaChiaviViewController;

@interface TrovaChiaviAppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet TrovaChiaviViewController *viewController;
@end

and this is .m

#import "TrovaChiaviAppDelegate.h"
#import "TrovaChiaviViewController.h"

@implementation TrovaChiaviAppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{

}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    [application release];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{

}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
}
- (void)applicationWillTerminate:(UIApplication *)application
{

}
- (void)dealloc
{
    [_window release];
    [_viewController release];
    [super dealloc];
}

@end

preguntado el 08 de noviembre de 11 a las 17:11

3 Respuestas

I don't see where you are setting your viewController property, add

self.viewController = [[[TrovaChiaviViewController alloc] initWithNibName:@"TrovaChiaviViewController" bundle:nil] autorelease];

antes de

self.window.rootViewController = self.viewController; 

respondido 18 nov., 11:23

I just had this issue when I was changing the application from iPhone only to iPad. The error message "Applications are expected to have a root view controller at the end of application launch" was happening because in the application-info plist, there was an entry specifying a nib file for MainWindow when I was no longer using a nib.

contestado el 26 de mayo de 12 a las 21:05

Although this is an older thread, I thought I'd contribute. Sometimes I select a template when creating new projects. There were two cases when I created empty projects. In both of these cases, I encountered the same problem.

Refer to this link. http://www.mumuen.com/2011/09/applications-are-expected-to-have-root.html

In my case, the key was that I had failed to allocate space for both my window and root controller.

Respondido el 17 de enero de 12 a las 04:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.