• 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
Re: dynamically adding and binding NSTableColumns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamically adding and binding NSTableColumns


  • Subject: Re: dynamically adding and binding NSTableColumns
  • From: mmalcolm crawford <email@hidden>
  • Date: Sun, 7 Nov 2004 09:20:41 -0800


On Nov 7, 2004, at 7:45 AM, Jonathan 'Wolf' Rentzsch wrote:
I'm creating my columns at runtime based on user-entered data. I thought
I could just allocate NSTableColumns as I need them, create an
NSArrayController and bind them up.
This works when I have just one column, but fails as I add more.
[...]
What am I doing wrong? I suspect it lies on the fact I'm using multiple
NSArrayControllers with a single NSTableView.

That could be it...  :-)

Dynamic addition/removal of table columns certainly does work if you use a single array controller and key paths. Is there any reason you want to use multiple controllers? (It may help if you think of them as being analogous to display groups...)

One particular issue you may want to consider in future is how to dynamically associate localised table column headers. This may be "fiddly" if you do everything programatically. An alternative, if possible, is to create your entire user interface in IB in advance, and at runtime remove and cache those columns you don't need, adding them back as needed...

mmalc

_______________________________________________
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


References: 
 >dynamically adding and binding NSTableColumns (From: "Jonathan 'Wolf' Rentzsch" <email@hidden>)

  • Prev by Date: dynamically adding and binding NSTableColumns
  • Next by Date: Re: dynamically adding and binding NSTableColumns
  • Previous by thread: dynamically adding and binding NSTableColumns
  • Next by thread: Re: dynamically adding and binding NSTableColumns
  • Index(es):
    • Date
    • Thread