Re: Getting a table to resize columns. I'm doing everythingright but it's not working?
Re: Getting a table to resize columns. I'm doing everythingright but it's not working?
- Subject: Re: Getting a table to resize columns. I'm doing everythingright but it's not working?
- From: John Bishop <email@hidden>
- Date: Thu, 27 Apr 2006 19:56:59 -0500
Matt Neuburg <email@hidden> said:
>On Mon, 24 Apr 2006 15:02:59 -0500, John Bishop <email@hidden>
>said:
>>Yes... it's possible that you've specified an autosave name for the
>>NSTableView, which causes column info and sizes to be written to your
>>preferences. If you change the configuration of the columns (different
sizes,
>>more or fewer columns, etc.) without throwing out the old preferences,
column
>>resizing won't work - at all or erratically - when you next run the
>>application
>
>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, but I'd start with something like
this:
NSString *key =
[NSString stringWithFormat:@"NSTableView Columns %@", autosaveName];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
That's how you delete other stuff from user preferences (and return to
"factory" preferences"), so I suppose you could delete autosaved stuff the
same way. Your mileage, of course, may vary.
John
------------------------------------------------------------------
John Bishop <mailto:email@hidden>
Mulligan Software <http://www.mulligansoftware.com>
Mulligan's Golf Personal - Stats & Handicapping for the Mac Golfer
_______________________________________________
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