Re: Fielding another question
Re: Fielding another question
- Subject: Re: Fielding another question
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 22 May 2002 18:16:41 -0700
On Wednesday, May 22, 2002, at 06:02 PM, David Wood wrote:
I finally got the books, so I FINALLY feel I have the right to
post questions on the list. My previous question still stands,
by the way, since I can't get custom menu items in an Cocoa
Document-based application to work. And having done more
reading, I have MORE stupid questions...
The app I'm trying to build has some curious interface issues.
The best way to describe it: at present, it requires two
NSTableViews to pull off. I'm tracking two different kinds of
objects (well, four, but those need to be listed in other
windows anyway), and it has an effect on the code:
- (void)tableView:(NSTableView *)tableView
setObjectValue:(id)object
forTableColumn:(NSTableColumn *)tableColumn
row:(int)row
{
if (tableView == listChars) {
[[characterKeys objectAtIndex:row] takeValue:object
forKey:[tableColumn identifier]];
[characterKeys sortUsingSelector:@selector(compare:)];
[listChars reloadData];
} else if (tableView == listSubps) {
[[subplotKeys objectAtIndex:row] takeValue:object
forKey:[tableColumn identifier]];
[subplotKeys sortUsingSelector:@selector(compare:)];
[listSubps reloadData];
}
}
For one NSTableView, it's simple enough, but two starts getting
hairy. Is there some more elegant way of doing this?
I would typically have a separate data source object for each tableview.
Or better yet... can I create TWO windows in my NSDocument.nib file?
Sure you can. Just drag another window off the palette in the IB.
This would afford me more screen real estate, windows can be
overlapped and moved around as they need to... but NSDocument
would still be receiving the
tableView:setObkectValue:forTableColumn:row: message, wouldn't
it?
The datasource messages will get sent to whatever object you
hook up to the dataSource outlet of the tableview(s) in question.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.