Adding Type-ahead to tableView
Adding Type-ahead to tableView
- Subject: Adding Type-ahead to tableView
- From: Jan Van Tol <email@hidden>
- Date: Tue, 26 Nov 2002 18:24:13 -0600
List,
I'm working on adding type-ahead functionality to my app, so I
sub-classed NSTableView, and overrode keyDown like this:
- (void)keyDown:(NSEvent *)theEvent {
[self interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
}
Then I overrode insertText: like so:
- (void)insertText:(NSString *)aString {
//select the proper row here
}
Previously, in my NSWindowController sub-class in which the tableView
is contained, I did this:
[[self window] makeFirstResponder:tableView];
Everything works great, except for one thing. When ever I hit return
to push the default button in my window, it just beeps at me. How can
I work this so that the return key will act normally?
And a second question: Right now, in myTableView, I'm using [[self
dataSource] tableData] to get the array that my table is displaying.
tableData is a method I implemented in myTableView's data source. It
seems silly to me to have to get the data like that, there must be some
way to access what my table is displaying directly from myTableView.
Failing that, what's the best way to get an array containing the
contents of myTableView?
Thanks in advance,
-Jan Van Tol
_______________________________________________
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.