gpt4 book ai didi

objective-c - @LWWFirstController 没有可见接口(interface)声明选择器 initWithStyle

转载 作者:行者123 更新时间:2023-11-29 11:10:44 24 4
gpt4 key购买 nike

我收到错误“@LWWFirstController 的可见接口(interface)声明了选择器 initWithStyle”。我已经编写了类似的代码来设置我的导航 Controller 并且它工作正常,但我似乎无法找到导致此错误的原因。我已经在 StackOverFlow 上寻找类似的问题,但没有一个适合,我正在使用正确的方法。有人知道吗?下面是我的代码。

#import "LWWAppDelegate.h"
#import "LWWFirstLevelController.h"

@implementation LWWAppDelegate

@synthesize window = _window;
@synthesize navController;




#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

LWWFirstLevelController *first = [[LWWFirstLevelController alloc] initWithStyle:UITableViewStylePlain];

self.navController = [[UINavigationController alloc]
initWithRootViewController:first];
[self.window addSubview:navController.view];

self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];

return YES;
}

最佳答案

它基本上是说您没有在 LWWFirstLevelController 中实现 initWithStyle 方法。

你确定它是 UITableViewController 的子类吗?

关于objective-c - @LWWFirstController 没有可见接口(interface)声明选择器 initWithStyle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11711406/

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