Re: Repost: NSTableView headaches (please help!)
Re: Repost: NSTableView headaches (please help!)
- Subject: Re: Repost: NSTableView headaches (please help!)
- From: "Brad Peterson" <email@hidden>
- Date: Wed, 30 Jul 2003 18:43:42 +0000
Hi John, et al,
You're right -- I should have included more details (sorry -- I'm sometimes
too frustrated by this to see clearly).
So... here's what I know...
Yes, it uses a dataSource (the controller itself).
Yes, it uses delegates (the controller itself).
Yes, I've tried [theTable reloadData]
Yes, the numberOfRowsInTableView returns 0 when appropriate. (I'm NSLogging
it to confirm.)
Yes, I've also tried [theTable setNeedsRedisplay:YES]
What the NSTableView now does is show the contents of (for a simplified
explanation) a drop box folder. It can be empty, but isn't always. Items are
displayed with a small image indicating whether said item is a file or
folder. (Originally, I thought the problem was in willDisplayCell as it was
excepting out in a few of the "no items" cases, but I've since fixed by
adding an exception handler and a few other catches.)
This is the section of code that seemed to be the problem (loads the new
folder contents from an NSArray called newItems):
[ itemList removeAllObjects ];
[ tableFiles setNeedsDisplay: YES];
[ tableFiles reloadData ];
[ tableFiles setNeedsDisplay: YES];
if (![newItemList count]){
[ self setBusy:NO];
return;
}
[itemList addObjectsFromArray: newItemList];
[ tableFiles reloadData ];
[ tableFiles scrollRowToVisible: 0 ];
When I added the setNeedsDisplay lines above, at first it seemed to work,
but again, not reliably. *sigh*
(Did I mention I'd inherited this code? ;) )
Does this help to shed light on things? I hope this is clearer (and
apologize again for not giving enough info before).
Thank you!!!!
Brad
From: john terranova <email@hidden>
To: Brad Peterson <email@hidden>
CC: email@hidden
Subject: Re: Repost: NSTableView headaches (please help!)
Date: Wed, 30 Jul 2003 11:05:07 -0700
On Wednesday, July 30, 2003, at 10:01 AM, Brad Peterson wrote:
The problem I'm trying to deal with is that it doesn't seem to correctly
redraw itself in the case of no records. (In the FTP sense, there would
never be such a case as there would always be the . and .. folders.)
I assume that things are ok until the list changes from having items to
having no items. Are you sending [theTable reloadData]? Is your
dataSource returning zero for numberOfRowsInTableView? Do you just need to
send [theTable setNeedsRedisplay:YES]?
That is what I would look at, in that order.
--
john terranova, email@hidden
"The world would one day be filled with nothing but those little cogs,
little men clinging to little jobs and striving towards bigger ones."
-- Max Weber
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.