added table column won't show because of autosaving
added table column won't show because of autosaving
- Subject: added table column won't show because of autosaving
- From: Matt Neuburg <email@hidden>
- Date: Fri, 28 Apr 2006 08:23:27 -0700
- Thread-topic: added table column won't show because of autosaving
On Thu, 27 Apr 2006 19:56:59 -0500, John Bishop <email@hidden>
said:
>>That was very helpful, and explains why, when I added a column to my table
>>in IB, I couldn't get it to appear in the running app. So what's the correct
>>approach here, from a coding point of view? In other words, what does
>>"throwing out the old preferences" consist of, and do I need to bracket my
>>changes by turning autosaving off and on? Thx - m.
>
>If you just want to remove the NSTableView columns autosave entry, then you
>can manually use Property List Editor on your
>"com.yourIdentifier.yourApp.plist", which is stashed in your
>~/Library/Preferences/ directory. Just look for an array called "NSTableView
>Columns *AutosaveName*" and delete it. You might want to delete the
>corresponding "NSTableView Sort Ordering *AutosaveName*" array too, if it
>exists.
>
>If you mean programmatically how do you delete the same items, I haven't
>thought about it much, or tried it at all
Okay, let me open up the question to people who *have* thought about it and
tried it.
Here's the problem. My app went out into the world with two columns in the
table and autosaving of the table turned on. Now, for a new version of the
app, I've added a third column (in IB). But when I run the new version of
the app, the third column doesn't show! The reason is apparently that the
autosave information, already stored in the plist file from the last time
the old version of the app ran, causes the third column to be stripped out
as the nib loads.
Now the question is: what's the correct way to proceed? I would rather NOT
tell all my users that they must delete the plist file manually; I would
like my app to do something as it starts up, so as to fix the problem. But
what?
In the archives, I see people wrestling with dynamic table columns and
autosave all the time. And Corbin Dunn has described the problem beautifully
and perceptively (but, alas, has called it a bug):
> 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!
So I'm hoping someone has worked out a solution. I fear I know what the
answer is (namely: "There is no solution; you will have to add the column in
code, not in IB"), but I'm hoping... :) Thx - m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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