Re: No Reference to Table Column
Re: No Reference to Table Column
- Subject: Re: No Reference to Table Column
- From: Corbin Dunn <email@hidden>
- Date: Wed, 5 Oct 2005 16:05:18 -0700
Am Oct 5, 2005 um 7:11 AM schrieb Philip Dow:
I have an IBOutlet connected to an NSTableColumn in my nib file. It
is possible to remove this column from the NSTableView during
runtime. The table's state is saved by way of the autosave name,
which I am setting in IB. When the program runs the next time, the
column does not appear in the view. All good.
See my comments below -- I don't think that is all that good (for the
reasons I mention below).
There are times when I need to add that column back to the table, a
user preference type thing. However, trying to use the IBOutlet to
reinsert the removed column throws any number of errors. During
debug, I check the pointer to this column and it comes up as
various objects at various addresses, sometimes an NSString,
sometimes an NSNumber, sometimes nothing in particular, even though
it is typecast as an IBOutlet *NSTableColumn.
Well, the issue is that the tablecolumn no longer exists; the
tableview removed it when it loaded itself. I consider this a bug;
any tablecolumns present in the nib which are not present in the
saved out list, should not "simply disappear" (mainly for the reason
that you just mentioned). I will fix that. A related bug is to set
the autosave name, run your app, add a new column in IB, and run your
app again; the new column will never appear!
Currently, the work around for your problem is to create new
tablecolumns in code. Eventually, I would like a tablecolumn to have
something like a visible property that is streamed out in the list.
If so, is there a way to maintain a reference to this column
regardless the autosave setting?
There isn't; you must create it in code.
--corbin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden