• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Specific table column causes problems in NSTableViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Specific table column causes problems in NSTableViews


  • Subject: Specific table column causes problems in NSTableViews
  • From: Simone Manganelli <email@hidden>
  • Date: Mon, 16 Dec 2002 15:59:30 -0800

I'm having some problems with a specific column in some NSTableViews. I have my preferences set up so that my users can disable and enable select columns as needed in a couple NSTableViews. All the NSTableViews are set up the same way, except they contain some different data, so when the user toggles the preference for a specific column in the preference, it either adds or removes the column from all four NSTableViews (and I found out that you need to make four separate copies of the NSTableColumn you're adding so that you don't add the same column to all four NSTableViews, which causes some undesired effects).

The problem is that one of my columns is causing me so many problems. I have my program set up so that the defaults for the visibility of the columns is saved into prefs, and then when the program is started, it removes all the columns that the user doesn't want (all the columns are created in the nib file first, so they all start out visible, and then the program transparently removes them before the window is shown). However, after a user activates a specific column, this method messes up -- specifically, any columns that are enabled after you enable this specific column do not show up after any subsequent launches of my program. (For example, let's say A is the problem column, and you start out with columns B, C, and D. Now you enable E, then A, and then F. On the subsequent launch, only B, C, D, E, and A will appear. Furthermore, if you now disable and reenable columns C, D, and E, only columns B and A will appear on the subsequent launch. However, if you never enable column A, you can enable and disable all the other columns as desired without any ill effects.)

I've also noted one other curious thing about this column: when you enable it, it appears as the rightmost column in all four NSTableViews. I have the autosave name entered in Interface Builder for all NSTableViews. However, if you quit as soon as you enable this problem column and then restart the program, it always appears as the third column in the NSTableViews, even though you didn't move it from it's rightmost position. Note that in Interface Builder this column is set up to be the third column (unless of course you have one or both of the previous columns disabled, in which case it appears as the first or second column after you enable it).

I've checked to make sure the identifiers for the column is different from all other columns in the same NSTableView (but I am using the same identifier for the same column in different NSTableViews, which has never caused me a problem before). I've also checked to make sure that the subroutines that remove the columns are not being called accidentally, by logging when this happens.

I can't seem to find the cause of the problem. I've considered changing my program so instead of deleting columns at startup, it starts out with no columns in Interface Builder and then just adds them all programatically. However, this would likely have the undesirable effect of not saving the positions and sizes of the columns that the user sets.

Any ideas? I would greatly appreciate assistance with this problem.

-- Simone Manganelli
_______________________________________________
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.

  • Prev by Date: NSTextView headers and footers?
  • Next by Date: Re: AppleScript little problem...
  • Previous by thread: Re: NSTextView headers and footers?
  • Next by thread: Writing nested dictionary fails
  • Index(es):
    • Date
    • Thread