@LWWFirstController没有可见接口声明选择器initWithStyle
我收到错误“@LWWFirstController没有可见接口声明选择器initWithStyle”。我已经写了类似的代码来设置我的导航控制器,它运行良好,但我似乎无法找到是什么原因导致此错误。我查看了StackOverFlow的类似问题,但没有一个适合,我使用正确的方法。有人有线索吗?以下是我的代码如下。@LWWFirstController没有可见接口声明选择器initWithStyle
#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
的子类吗?
Ah dang it!你的权利Selkie..I抬头头文件我有这个: @interface LWWFirstLevelController:UIViewController – SaintClaire33 2012-07-29 17:40:05
我改变它,并清除它。感谢您指出Selkie! @interface LWWFirstLevelController:UITableViewController – SaintClaire33 2012-07-29 17:42:58
不客气 – Selkie 2012-07-29 17:46:53
您可以在您的问题中添加“LWWFirstLevelController.h” - 您可能会通过再次包含应用程序代理的.h文件来获取循环导入 – deanWombourne 2012-07-29 17:37:55