我得到的错误是:
''UIStoryboard'没有可见的@interface声明选择器 instantiateInitialViewControllerWithIdentifier:
感谢您的帮助。
#import "initViewController.h"
#import "ECSlidingViewController.h"
#import "MenuViewController.h"
@interface initViewController ()
@end
@implementation initViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.topViewController = [self.storyboard instantiateInitialViewControllerWithIdentifier:@"Main"];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
答案 0 :(得分:2)
UIStoryboard未按该名称实施方法。它实现了instantiateViewControllerWithIdentifier:
,看起来就像你需要的那样。
答案 1 :(得分:0)
(1)将#import <UIKit/UIKit.h>
添加到文件顶部&amp;确保你准确地拼写了这个方法。
(2)班级名称应大写。