Re: scrollRowToVisible and NSTableView
Re: scrollRowToVisible and NSTableView
- Subject: Re: scrollRowToVisible and NSTableView
- From: Quentin Mathé <email@hidden>
- Date: Sat, 18 Jan 2003 02:41:18 +0100
Le vendredi, 17 jan 2003, ` 06:15 Europe/Paris, Chad Armstrong a icrit :
Hello,
I'm writing an application which uses a NSTableView, and when too many
items fill up the table and the scroll bar appears, I want the table
to shift to the last item (or the last item which was put in). I
found some code, however it seems to shift to the item just ABOVE the
one I want. And if I try and shift by 1, it does nothing, or just
jumps to the top. Here is the example code:
- (IBAction) addNewItem:(id) sender
{
[myStuff addObject: [inputField stringValue];
[inputField setStringValue: @""];
[table scrollRowToVisible: [myStuff count] - 1];
[table reloadData];
}
I think you should put the line [table reloadData]; before the line
[table scrollRowToVisible: [myStuff count] - 1];.
--
Quentin Mathi
email@hidden
_______________________________________________
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.