【发布时间】:2011-11-08 17:37:09
【问题描述】:
当我在 iphone 模拟器中启动我的应用程序时,它没有任何问题。如果我在设备上启动它会在我打开它时崩溃。但是当我启动模拟器时,它会说这个问题:
Applications are expected to have a root view controller at the end of application launch
wait_fences: failed to receive reply: 10004003
我能做什么? 这是我的应用程序委托:
.h:
#import <UIKit/UIKit.h>
@class TrovaChiaviViewController;
@interface TrovaChiaviAppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet TrovaChiaviViewController *viewController;
@end
这是.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
【问题讨论】:
标签: objective-c uiviewcontroller emulation uiapplicationdelegate