我收到错误消息“@LWWFirstController声明选择器initWithStyle没有可见的接口”。我已经编写了类似的代码来设置我的导航控制器,它工作得很好,但我似乎找不到是什么导致了这个错误。我在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;
}发布于 2012-07-30 01:37:38
它基本上是说你没有在LWWFirstLevelController中实现initWithStyle方法。
您确定它是UITableViewController的子类吗
https://stackoverflow.com/questions/11711406
复制相似问题