NSTableView
NSTableView
- Subject: NSTableView
- From: "john darnell" <email@hidden>
- Date: Fri, 23 May 2008 15:03:18 -0500
- Thread-topic: NSTableView
Hello Everyone:
First of all, I want you all to know that I am attempting to limit
myself to a single question per day to this list. I am trying not to
wear out my welcome.
I am attempting to play with a tableView. I build a list of files using
NSArray, and then I attempt to use the information found in the
companion article to NSTableView in help to populate it. I refer to the
sub-article on hooking a tableView up to a datasource.
The controller file is named FileController. The datasource is
specified as FileController. The outlet is named directoryTable and it
is linked to FileController.
The code used to return the number of rows in the tableView looks like
this:
- (int) numberOfRowsInTableView: (NSTableView *) aTableView
{
int a = [arrayOfFiles count];
NSLog(@"The number of rows in the table is %d", a);
return [arrayOfFiles count];
}
arrayOfFiles is populated with filenames, and is retained, as required.
Stepping through the code, I find that the above code works.
The first two lines in the above call are there for debugging purpose.
The code meant to be used in response for the requirement in the
Companion article to return the value of a given cell in the table looks
like this:
- (id) directoryTable: (NSTableView *) aTableView
objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int)
rowIndex
{
NSLog(@"Row index is %d", rowIndex);
NSString *file = [arrayOfFiles objectAtIndex:rowIndex];
return [file self];
}
The problem is that the tableView is not populated. When I step through
the code and place a breakpoint at the top of the above call, I never
exercise the breakpoint, which means it is never getting called. Can
anyone see what my problem is?
R,
John A.M. Darnell
Team Leader
Walsworth Publishing Company
Brookfield, MO
John may also be reached at email@hidden
Trivia Question: In SciFi Channel's hit series, FARSCAPE, who played
the voice of Pilot?
Answer: The voice of Pilot was played by Lani Tupu, the same actor who
played the villain-turned-refugee, Crais.
_______________________________________________
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