Re: NSTableView [solved]
Re: NSTableView [solved]
- Subject: Re: NSTableView [solved]
- From: David Blanton <email@hidden>
- Date: Mon, 23 Feb 2004 10:32:56 -0700
On 2/23/04 3:22 AM, "Scott Little" <email@hidden> wrote:
>
David,
>
>
Uh, that is not exactly clear to me. I will probably be having this
>
problem in the near future and I would like to understand how to solve
>
it. What exactly is it that you learned?
>
>
Is it that loading in init and reloading in awakeFromNib is the right
>
behavior or wrong, and if wrong what is the right behavior? Certainly
>
not forcing the user to click on a manual reload button?
>
>
Thanks,
>
>
Scott
>
>
You and I, we reject these narrow attitudes
>
We add to each other, like a coral reef - Neil Peart, Rush
>
Building bridges on the ocean floor "Alien Shore"
>
Reaching for the alien shore
>
--
>
scott little
>
email@hidden
>
>
On 23 Feb, 2004, at 07:24, David Blanton wrote:
>
>
> Original Post
>
> -----------------------------------------------------------------------
>
> ---
>
> Problem: NSTableView does not display scroll bars.
>
>
>
> Archive says: This is a common problem. You must send a reloadData
>
> message
>
> to the NSTableView for scroll bars to be displayed.
>
>
>
> Result: The NSTableView is displayed with a scroll bar. It does get
>
> the
>
> reloadData message as well as the setNeedsDisplay:YES message. There
>
> are
>
> more rows in the table than can be displayed yet there is no knob in
>
> the
>
> scroll bar.
>
>
>
> Question: What the heck am I not doing?
>
>
>
> Arrrgggg and thanks!
>
>
>
> David Blanton
>
> -----------------------------------------------------------------------
>
> ---
>
> Solution
>
> -----------------------------------------------------------------------
>
> ---
>
> It was a matter of WHEN the reloadData message is sent. I was
>
> loading the
>
> array in 'init' and and sending reloadData in 'awakeFromNib' because I
>
> wanted everything ready when the view was displayed.
>
>
>
> So I added a button 'Manual' and load the array and send reloadData
>
> when
>
> clicked.
>
>
>
> I learned something. Thanks to all.
>
>
>
> DB
More specifically:
I was making a table of null values for the user to update/edit. I wanted
this functionality ready when the use tabbed to that view. So I loaded the
array with NSString @" " for each cell and then sent reloadData when the
user tabbed to the view. This did not produce the knob in the scroll bar.
So I did as described above, same result. Since my app is designed to
either import data for the table or allow manual entry a view with buttons
'Manual' and 'Import' is OK for the user. The manual method is below:
/***************************************************************************
* Function: manual
* Class: KillListDataSource
* Purpose:
* Last Modified: DB 2.22.04
***************************************************************************/
- (IBAction)manual:(id)sender
{
int i;
g_killListArray = [[NSMutableArray alloc] init];
for(i=0;i<kManualLoadCount;i++)
{
KillList * dummyList = [[KillList alloc] init];
[dummyList setCap:@" "];
[dummyList setPin:@" "];
[dummyList setPassword:@" "];
[dummyList setAll:@" "];
[dummyList setScores:@" "];
[dummyList setHc:@" "];
[g_killListArray addObject:dummyList];
[dummyList release];
}
[m_killList reloadData];
}
The import method will look similar with data for a selected file to load
the array.
_______________________________________________
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.