NSTableView não está sendo exibido

Este é um acompanhamento da pergunta anterior. Desculpa. Não consegui descobrir como adicionar código ou editar algo escrito há mais de 5 minutos.

Um breve resumo. Estou tentando exibir um TableView personalizado / derivado em uma exibição regular. Não estou usando o IB, mas fazendo tudo do código. O objetivo aqui é criar o aplicativo, mas também aprender a programação do Cocoa / OSX. Esta é minha primeira tentativa de codificação OSX.

O NSView sobre o qual eu gostaria de exibir meu TableView personalizado está sendo exibido corretamente. Por favor, desculpe o lixo do NSLog. Isso me ajuda a aprender sobre o ciclo de vida do aplicativo. Cabeçalho:

#import <Cocoa/Cocoa.h>
#import "MSNavigationTableView.h"

@interface MSNavigationPanelView : NSView

@property (strong, nonatomic) IBOutlet MSNavigationTableView *myNavigationTable;

@end

código:

#import "MSNavigationPanelView.h"

@implementation MSNavigationPanelView

- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
        NSLog(@"Initializing Navigation Panel");
    }
    self.myNavigationTable = [[MSNavigationTableView alloc] initWithFrame:self.frame];
    [self.myNavigationTable setDataSource:self.myNavigationTable];
    [self.myNavigationTable setDelegate:self.myNavigationTable];
    [self addSubview:self.myNavigationTable];
    return self;
}

- (void)drawRect:(NSRect)dirtyRect
{
    [super drawRect:dirtyRect];
    // Drawing code here.
    NSLog(@"Drawing navigation view!");
}

@end

Agora a classe derivada NSTableView. Cabeçalho:

#import <Cocoa/Cocoa.h>

@interface MSNavigationTableView : NSTableView <NSTableViewDataSource>

@end

NSArray *myNavigationArray;

Fonte:

#import "MSNavigationTableView.h"

@implementation MSNavigationTableView

+ (void)initialize {
    NSLog(@"Called NavigationTableView::initialize!");
    myNavigationArray = [NSArray arrayWithObjects:@"Call History" @"Contacts", @"Messages", @"Voicemail", nil];
}

- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    return self;
}

- (void)drawRect:(NSRect)dirtyRect
{
    [super drawRect:dirtyRect];
    // Drawing code here.
}

- (NSInteger)numberOfRowsInTableView: (NSTableView *) aTableView
{
     return [myNavigationArray count];
}

- (id)tableView: (NSTableView*) aTableView objectValueForTableColumn: (NSTableColumn *)aTableColum row: (NSInteger)rowIndex
{
    NSLog([myNavigationArray objectAtIndex:rowIndex]);
    return [myNavigationArray objectAtIndex:rowIndex];
}

@end

Obrigado. Estou certo de que estou fazendo algo estúpido e / ou talvez não esteja fazendo algo necessário. Eu tentei descobrir isso por algumas horas. Nenhuma idéia até agora.

questionAnswers(2)

yourAnswerToTheQuestion