Re: NSTableView does not show contents on startup
Re: NSTableView does not show contents on startup
- Subject: Re: NSTableView does not show contents on startup
- From: email@hidden
- Date: Mon, 25 Aug 2003 12:26:26 +0200
i thought there was a way...and i think there should, but i might get the
philoso|hy wrong here...
anyhow, it looks like you either have to make a connection, you could
subclass the nstableview and in its awakeFromNib you could call reloadData
(or even fire a short timer to do this after a slight deley...or afaik there
is an asynchronious method defined caller performAction: after delay: for
every NSObject) or you could try to send a nil targeted action using NSApps
sendAction: from: to: where action is @selector(reloadData) without a colon
(that way it will actually ignore the sender...).
hope that is of any help.
daniel o.
ps: are u really this lists admin?
Administrator schrieb:
Hello,
I am trying to write an app which displays a table of information. I have
created
a window containing an NSTableView wrapped in an NSScrollView.
I also have a controller class which is set to be the application's
delegate. It
implements the applicationDidFinishLaunching method in which it loads data
from a file and populates an NSArray (which contains the table's data).
The controller it also set as the NSTableView's data source.
The problem is that on startup the window appears but the table is empty.
Resizing the window has no effect, nor does switching to another app
(which covers the table window). However resizing the window or minimizing
it and then bringing it back to the front both result in the table being
displayed
with it's data.
It therefore appears that the table does not cause it's data to be
displayed on startup.
I confirmed this by making the controller class the NSTableView's delegate
and
implementing tableView:willDisplayCell:forTableColumn:row: (which
according to
the docs is called before each cell is displayed) to print a message on
the console
with NSLog. No messages appeared until the window was resized.
I also tried implementing applicationWillFinishLaunching instead but with
the same result.
The docs don't seem to give any further information.
(1) Can anyone tell me what I am doing wrong?
I read a recent post here suggesting that [table reloadData] needs to be
called. This sounds
sensible but then I need a reference to the NSTableView so I can use it as
the receiver in the
message. So my second problem:
(2) Is there a general way to obtain a reference to an object created in
IB and loaded from the
nib at runtime in my code?
Any help appreciated.
Thanks,
Tim Mowlem
_______________________________________________
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.
_______________________________________________
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.