NSTable Newbie Issues
NSTable Newbie Issues
- Subject: NSTable Newbie Issues
- From: Kodex <email@hidden>
- Date: Tue, 13 Jul 2004 14:45:35 -0700 (PDT)
I am trying to get a few tables working on my app. I
have a diffrent controller for each one. And 3 out of
the 4 will have static data. I having been trying to
follow the guides out there and none of them seem to
work. I compile with no errors and console dosnt dump
any errors on me. I was wondering if anyone could spot
the trouble with my code. Thanks
//Header file contents
// IBOutlet NSTableView *personal_Table;
// NSMutableArray *records;
// NSString *name;
#import "personalTable.h"
@implementation personalTable
-(void)windowDidLoad
{
[personal_Table setDataSource: records];
name = @"test";
[records addObject:name];
[personal_Table reloadData];
}
- (id)tableView:(NSTableView *)personal_Table
objectValueForTableColumn:(NSTableColumn
*)aTableColumn
row:(int)rowIndex
{
id theRecord, theValue;
NSParameterAssert(rowIndex >= 0 && rowIndex <
[records count]);
theRecord = [records objectAtIndex:rowIndex];
theValue = [theRecord objectForKey:[aTableColumn
identifier]];
return theValue;
}
- (void)tableView:(NSTableView *)personal_Table
setObjectValue:anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
id theRecord;
NSParameterAssert(rowIndex >= 0 && rowIndex <
[records count]);
theRecord = [records objectAtIndex:rowIndex];
[theRecord setObject:anObject forKey:[aTableColumn
identifier]];
return;
}
- (int)numberOfRowsInTableView:(NSTableView
*)personal_Table
{
return [records count];
}
@end
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.