1

AppDelegate.hには@property (nonatomic, strong) IBOutlet UIWindow *windowと があり@property (nonatomic, strong) IBOutlet UITabBarController *tabBarControllerます。

実装では I @synthesize *window = _window, *tabBarController = _tabBarController;.

私のターゲット設定では、私のMainWindow.xibファイルが指定されています。

私のファイルには、 、 、 のMainWindow.xib3 つのオブジェクトがあります。、 、、に接続します。AppDelegateWindowTab Bar ControllerWindowAppDelegateTab Bar ControllerWindow.rootViewControllerTab Bar ControllerAppDelegate

に戻るとAppDelegate.h、コンセントの円が接続済みとして表示されます。

最後に、私のAppDelegate.mファイルで:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self.window makeKeyAndVisible];

    NSLog(@"%@",self.window);

    return YES;
}

このログの内容は常に(null).

アプリケーションの起動時に、ウィンドウとタブ バー コントローラーが表示され、ユーザーの操作を受け取ります。

何がうまくいかないのですか?

4

1 に答える 1

0

問題は、ファイルの所有者クラスがApplicationDelegateではなくクラスに設定されていたことですUIApplication。これを正しいクラスに設定し、デリゲートをのデリゲートとして設定するとUIApplication、問題が完全に解決されました

于 2012-03-01T19:22:00.540 に答える