2010-10-28 51 views

回答

4

让我们假装你有一个CoolViewController类。

里面你CoolAppDelegate.h你需要有这样的事情:

@class CoolViewController; 

@interface CoolAppDelegate.h : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    CoolViewController *viewController; 
} 

然后你CoolAppDelegate.m将需要

application:applicationdidFinishLaunchingWithOptions: 

方法有一些像这样的代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    // Override point for customization after app launch. 

    // Add your cool controller's view to the window. 
    [window addSubview:viewController.view]; 
    [window makeKeyAndVisible]; 

    return YES; 
} 

为避免该错误,您可能还需要删除对IBOutlet的引用通过Interface Builder指向您的.xib文件中的rootViewController。

相关问题