It looks like Apple changed something and I can't figure it out. I looked at some old osx apps that work but a new project I am working on isn't.
Simple set up so far, TableView with 2 columns and when I press an NSButton it should fill the tableview with "102" in the ID column and "Pet Lounge..."
Included 4 photos to better illustrate what I see. The screen shot at 4:03 shows that I labeled the the text cells and also the identifier to the right under the identity inspector.
2 of the photos show the identifier is "idNum" and the other show the Client object has a value for idNum that is "102" which should be returned.
The last image is of the app after I pressed the button 3 times, it just says "Text View Cell" 3 times. I'm pretty sure I am missing something simple here and something has changed with the NSTableViews from previous versions. I did search for tutorials but everything I followed was old, nothing from xcode 6. Anyone have an idea of the step that I am missing?
Simple set up so far, TableView with 2 columns and when I press an NSButton it should fill the tableview with "102" in the ID column and "Pet Lounge..."
Included 4 photos to better illustrate what I see. The screen shot at 4:03 shows that I labeled the the text cells and also the identifier to the right under the identity inspector.
2 of the photos show the identifier is "idNum" and the other show the Client object has a value for idNum that is "102" which should be returned.
The last image is of the app after I pressed the button 3 times, it just says "Text View Cell" 3 times. I'm pretty sure I am missing something simple here and something has changed with the NSTableViews from previous versions. I did search for tutorials but everything I followed was old, nothing from xcode 6. Anyone have an idea of the step that I am missing?
Code:
#import "TableViewController.h"
@implementation TableViewController
-(id)init{
self = [super init];
if (self) {
list = [[NSMutableArray alloc]init];
}
return self;
}
-(void)awakeFromNib{
tableView.delegate = self;
tableView.dataSource = self;
}
-(IBAction)addButton:(id)sender{
[list addObject:[[Client alloc]init]];
[tableView reloadData];
}
-(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView{
return [list count];
}
-(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{
Client *c = [list objectAtIndex:row];
NSString *identifier = [tableColumn identifier];
return [c valueForKey:identifier];
}