1

私のAppDelegate.hには、@property (nonatomic, strong) IBOutlet UIWindow *window@property (nonatomic, strong) IBOutlet UITabBarController *tabBarControllerがあります。MainWindowアウトレットが接続されていても、window、tabBarControllerログのIBOutletプロパティ(null)

実装では、I @synthesize *window = _window, *tabBarController = _tabBarController;です。

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

私のMainWindow.xibファイルには、AppDelegate,Window、およびTab Bar Controllerという3つのオブジェクトがあります。私はWindowAppDelegateに、Tab Bar ControllerWindow.rootViewControllerに、Tab Bar ControllerAppDelegateに接続します。

AppDelegate.hに戻ると、アウトレットの円は接続されているように見えます。

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

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

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

    return YES; 
} 

このログの内容は常に(null)です。

アプリケーションの起動時に、ウィンドウとタブバーのコントローラーが表示され、ユーザーとの対話が表示されます。

何が問題になりますか?

答えて

0

File所有者クラスがUIApplicationではなくApplicationDelegateクラスに設定されていたという問題がありました。これを正しいクラスに設定し、デリゲートをUIApplicationの代理人に設定して、問題を完全に解決しました。

関連する問題