gpt4 book ai didi

ios - 应用程序窗口在应用程序启动结束时应该有一个 Root View Controller

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:49:20 25 4
gpt4 key购买 nike

当我的应用程序启动时出现上述错误。以下代码来 self 的 AppDelegate .h 文件

#import <UIKit/UIKit.h>

@interface TableViewAppDelegate : NSObject <UIApplicationDelegate> {

UIWindow *window;
UINavigationController *navigationController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@end

以下来 self 的AppDelegate实现文件.m applicationdidfinishlaunchingwithoptions

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

//Configure and show the window
[window addSubview:[navigationController view]];

[window makeKeyAndVisible];

return YES;
}

最佳答案

将此添加到您的应用委托(delegate)中:

self.window.rootViewController = navigationController;

关于ios - 应用程序窗口在应用程序启动结束时应该有一个 Root View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19819730/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com