0

私はベースビューコントローラを持っています:

@interface NEViewControllerWithSidebarMenu : UIViewController <UITableViewDataSource, UITableViewDelegate>
{
    UIView *viewWithContent;
    UIView *sidebarView;
    UITableView *sidebarTableView;
}

@property (nonatomic, retain) UIView *viewWithContent;
@property (nonatomic, retain) UIView *sidebarView;
@property (nonatomic, retain) UITableView *sidebarTableView;

-(void)menuButtonPressed:(id)sender;
-(void)loadSidebar;

@end

そしてそれは実装です:

#import "NEViewControllerWithSidebarMenu.h"

@interface NEViewControllerWithSidebarMenu ()

@end

@implementation NEViewControllerWithSidebarMenu

@synthesize sidebarView, sidebarTableView;
@synthesize viewWithContent;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Actions

-(void)menuButtonPressed:(id)sender
{
    ... do some things here
}


-(void)loadSidebar
{
    .....        
    UIButton *menuButton=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    [menuButton setFrame:CGRectMake(0.0, 0.0, 80, 40)];
    [menuButton setTitle:@"Меню" forState:UIControlStateNormal];
    [menuButton addTarget:self action:@selector(menuButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *menuBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:menuButton];
    self.navigationItem.leftBarButtonItem=menuBarButtonItem;
    .....

}

-(void)changeToViewController:(UIViewController *)viewController
{
    UINavigationController *navController = self.navigationController;
    [navController popViewControllerAnimated:NO];
    [navController pushViewController:viewController animated:NO];
}

-(void)popViewControllerAnimated
{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)pushViewControllerAnimated:(UIViewController *)viewController
{
    [self.navigationController pushViewController:viewController animated:YES];
}

#pragma mark - UITableViewDataSourse

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    switch (section)
    {
        case 0:
        {
            return 6;
            break;
        }
        default:
        {
            NSLog(@"PANIC: unknown section index");
            return 13;
            break;
        }
    };
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ......
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    .......
}

@end

今、NEViewControllerWithSidebarMenu から継承するコントローラーを宣言しています。エラーが発生します。

@interface NECompanyRootViewController : NEViewControllerWithSidebarMenu
{
    //
}

@end

「NEViewControllerWithSidebarMenu」、「NECompanyRootViewController のスーパークラス」のインターフェイス宣言が見つかりません

お願い助けて。このエラーが発生する理由と解決方法を教えてください。

4

1 に答える 1

2

最初にヘッダーをインポートします

#import "NEViewControllerWithSidebarMenu.h" 
@interface NECompanyRootViewController : NEViewControllerWithSidebarMenu
{
    //
}

@end
于 2012-11-02T09:41:13.383 に答える