• 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: Help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help!


  • Subject: Re: Help!
  • From: Joshua Pennington <email@hidden>
  • Date: Mon, 01 Sep 2008 08:09:26 -0500


On Sep 1, 2008, at 4:38 AM, Michael Robinson wrote:
I need to use a NSTableView to control data input by the user. The table has two columns, labeled "Title" and "Content". The number of columns is fixed.

I understand (from assorted hints I've seen online) that one may use a NSDictionaryController to handle data input/output/display/saving etc from a table.


I would use an NSArrayController that stores instances of NSDictionary. Each NSDictionary object will have a title key and a content key.

Then, bind your first table column to the array controller's arrangedObjects.title key & the second column to the array controller's arrangedObjects.content key.

Check out this tutorial for more information on setting up a table view - it first walks through using the traditional, non-bindings method, and then shows you how to use Cocoa Bindings for the task. While the tutorial there uses a mail application as an example, it *should* be close enough to point you in the right direction:

<http://cocoadevcentral.com/articles/000080.php>

For more information on Bindings, read:

<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html#//apple_ref/doc/uid/20002373 >

Cheers,
Joshua
_______________________________________________

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


References: 
 >Help! (From: Michael Robinson <email@hidden>)

  • Prev by Date: Re: I know this is a Studio question .. but I really need some help
  • Next by Date: Re: Image in NSOutlineView
  • Previous by thread: Help!
  • Next by thread: Increasing NSTextView's height
  • Index(es):
    • Date
    • Thread