1

我得到的错误是:

''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
4

2 回答 2

2

UIStoryboard没有实现该名称的方法。它确实实现instantiateViewControllerWithIdentifier:了,这看起来像你需要的。

于 2013-01-19T18:42:26.120 回答
0

(1) 添加#import <UIKit/UIKit.h>到文件顶部并确保您拼写正确的方法。

(2) 类名应大写。

于 2013-01-19T18:43:19.397 回答