• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTable Newbie Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTable Newbie Issues


  • Subject: Re: NSTable Newbie Issues
  • From: Hasan Diwan <email@hidden>
  • Date: Wed, 14 Jul 2004 11:21:44 -0700

Comments are delimited by ***.
On Wed, 14 Jul 2004 09:54:37 -0700 (PDT), Kodex <email@hidden> 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 <email@hidden>
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSTable Newbie Issues
      • From: Kodex <email@hidden>
References: 
 >Re: NSTable Newbie Issues (From: Kodex <email@hidden>)

  • Prev by Date: NSView menu
  • Next by Date: Re: NSView menu
  • Previous by thread: Re: NSTable Newbie Issues
  • Next by thread: Re: NSTable Newbie Issues
  • Index(es):
    • Date
    • Thread