Re: TableColumn visibility issue
Re: TableColumn visibility issue
- Subject: Re: TableColumn visibility issue
- From: Jerry Krinock <email@hidden>
- Date: Sun, 14 Oct 2007 13:30:10 -0700
On 2007 Oct, 14, at 12:43, Steve Cronin wrote:
I was under the impression that the tableView in the nib is archived
and not altered by any of the addTableColumn/removeTableColumn
activity.
Yes, that is correct. (Or else we're all in big trouble!)
However, during a later application launch, when I read the [tv
tableColumns] in the tableView's -awakeFromNib what I find is that
only the columns which were visible when the application was last
terminated are there.
It looks to me as though these statements in -windowDidLoad will do
that...
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
if ([ud boolForKey:@"hideFistName"] == YES) [listTableView
removeTableColumn:[[listTableView myTableColumns]
objectForKey:@"firstName"]];
if ([ud boolForKey:@"hideLastName"] == YES) [listTableView
removeTableColumn:[[listTableView myTableColumns]
objectForKey:@"lastName"]];
Your NSUserDefaults, ud, ^are^ saved between application launches, in
~/Library/Preferences/com.myCompany.MyApp.plist
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden