Re: NSTableView [solved]
Re: NSTableView [solved]
- Subject: Re: NSTableView [solved]
- From: Jerry Krinock <email@hidden>
- Date: Mon, 23 Feb 2004 06:52:30 -0800
I tested my application again and found that it only has the problem when
the _first_ "overflow" row is added, when it scrolls down so you can only
see _part_ of the first row. As David said, you get a scroller, but no
slider buttons in it. Looks weird. (But upon adding another row, the
buttons appear.) The workaround is to size the view so that an exact
integer number of rows will fit.
My code is as described below by Jeremy.
Jerry
on 04/02/23 03:44, Jeremy Dronfield at email@hidden wrote:
>
The "correct" place to tell your table view to reload its data is
>
immediately after the data changes - i.e. when the array is first
>
filled with objects, when an object is removed or added, or when the
>
array is sorted. For example:
>
>
myTableData = [[NSMutableArray alloc] initWithObjects:foo, bar, ...etc];
>
[myTable reloadData];
>
>
and/or
>
>
[myTableData addObject:foo];
>
[myTable reloadData];
>
>
Clicking a button is certainly not correct (unless clicking the button
>
alters the data in some way). The way I normally do it is to allocate
>
an empty mutable array in -init. Then I have a method or set of methods
>
responsible for maintaining the array - adding/removing objects,
>
clearing it and rebuilding it with different data and so on. At the end
>
of that method it will say [myTable reloadData]. I call this method in
>
-awakeFromNib. I call it again whenever a user action causes the data
>
to change.
_______________________________________________
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.