• 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: NSTableView Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView Problems


  • Subject: Re: NSTableView Problems
  • From: Graham Cox <email@hidden>
  • Date: Mon, 24 Nov 2008 10:43:48 +1100


On 24 Nov 2008, at 10:13 am, Barry Fawthrop wrote:

I have added an NSTableView linked it's datasource and deletegate to the
Controller object


I have the two required procedures

I use the following to add data into the Table

NSMutableArray *schedule;
NSTableView    *playlist;
NSString       *filename;
NSString       *length;

....
....
[schedule addObject: [NSArray arrayWithObjects: @"TIME", filename,
length, nil]];
[playlist reloadData];
....
....


When this is run the 3 column table just has ( ( ( that is a ( in each column [3 columns in total]

The data found within the filename and length variable
nor the "TIME" string found for the first column
are displayed

Where did I go wrong ?


It's not possible to say from the above snippet. The problem surely is in the dataSource methods, so let's see those.

Typically your dataSource method should look like this:

- (id) tableView:(NSTableView*) aTableView objectValueForTableColumn: (NSTableColumn*) aTableColumn row:(int) rowIndex
{
return [[scheduleArray objectAtIndex:rowIndex] valueForKey: [aTableColumn identifier]];
}
But there are many possible variants on that theme.


deletegate

That's the scandal where government emails were deliberately shredded, isn't it? ;-) (sorry)


--Graham




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTableView Problems
      • From: Graham Cox <email@hidden>
References: 
 >NSTableView Problems (From: Barry Fawthrop <email@hidden>)

  • Prev by Date: Re: NSPopupUpButton not showing checked menu items
  • Next by Date: Remove HTML Tags
  • Previous by thread: NSTableView Problems
  • Next by thread: Re: NSTableView Problems
  • Index(es):
    • Date
    • Thread