Re: NSTable Newbie Issues
Re: NSTable Newbie Issues
- Subject: Re: NSTable Newbie Issues
- From: Kodex <email@hidden>
- Date: Wed, 14 Jul 2004 16:50:45 -0700 (PDT)
Yes even with the data source set to self it still gives me no data on the table... Any other ideas of what might be causing my problems? thanks!
wrote:Comments are delimited by ***.
On Wed, 14 Jul 2004 09:54:37 -0700 (PDT), Kodex wrote:
>
> > //Header file contents
>
> > // IBOutlet NSTableView *personal_Table;
>
> >
>
> > // NSMutableArray *records;
>
> > // NSString *name;
>
> >
>
> >
>
> > #import "personalTable.h"
>
> >
>
> > @implementation personalTable
>
> >
>
> > -(void)windowDidLoad
>
> > {
>
> >
>
> > [personal_Table setDataSource: records];
***
The DataSource points to where your data source methods are defined.
It should be "self" from the looks of it.
***
>
> >
>
> > 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
--
Cheers,
Hasan Diwan
_______________________________________________
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.
Yahoo! Mail - 50x more storage than other providers!
_______________________________________________
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.