[Q] am I allowed to call NSTableDataSource informal protocol methods myself?
[Q] am I allowed to call NSTableDataSource informal protocol methods myself?
- Subject: [Q] am I allowed to call NSTableDataSource informal protocol methods myself?
- From: "Peter.Teeson" <email@hidden>
- Date: Tue, 27 Apr 2004 15:12:13 -0400
Boy Cocoa is truly fun and I am enjoying learning how to program in it.
(I find Objective-C easy and the Objective-C Language manual of Feb
2004 is extremely well written - one of the clearest I've ever read).
But enough of that - my current question is this:
When I want to access one of the attributes of an NSTableView is it
permitted to call one of the informal protocol methods
(id)tableView: (NSTableView *)tableView objectValueForTableColumn:
(NSTableColumn *)tableColumn row:(int)row
from within a MyDocument method?
Because at present to get the contents of the cell I now do the
following:
.....
// Get the text in the MAC Address cell and validate it
unsigned int row = [tableView selectedRow];
PasswordRecord *pwrec = [passwordRecords objectAtIndex:row];
tempDelimitedString =[pwrec macAddress]; // using the accessor
,,,,,,,
and it occurred to me that it would be more elegant to use
objectValueForTableColumn along the lines of:
tempDelimitedString = [tableView objectValueForTableColumn:[tableView
tableColumnWithIdentifier:@"macAddress"]:[tableView selectedRow]
_______________________________________________
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.