• 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: Get Value from NSArrayController Binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get Value from NSArrayController Binding


  • Subject: Re: Get Value from NSArrayController Binding
  • From: "Kyle Sluder" <email@hidden>
  • Date: Mon, 2 Jun 2008 12:58:50 -0400

On Mon, Jun 2, 2008 at 12:08 PM, Christian Isaacs
<email@hidden> wrote:
> 1)  How do I get the title value from my Events NSArrayController Object?
>  I've tried [eventTableView valueForKey:@"Events.arrangedObjects.title"] and
> different variations of it.

There are a few problem here.

1) You're asking the wrong object.  Why are you sending messages to
the table view to get things from the array controller?
2) The name of an object in the NIB is absolutely and totally
meaningless.  It's just a label for you when you use IB.  The only way
to access an object inside a NIB is to wire it up to an outlet that
you can somehow reach from the code in question.  So your attempts to
use a keypath to get at the array controller are misguided.
3) You don't understand how NSTableColumns use their cells.  You
provide an NSCell to the table column.  The column reuses that cell
for every row by calling -setObjectValue: with the proper object for
the row and then -drawWithFrame:inView:.  You might want to override
-setObjectValue: to invoke -setTitle: with the string you wish to
display.

HTH,
--Kyle Sluder
_______________________________________________

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: 
 >Get Value from NSArrayController Binding (From: Christian Isaacs <email@hidden>)

  • Prev by Date: NSPersistentDocument's metadata APIs, when can I set my metadata before saving?
  • Next by Date: Re: many-to-many relationships and retain cycles
  • Previous by thread: Get Value from NSArrayController Binding
  • Next by thread: many-to-many relationships and retain cycles
  • Index(es):
    • Date
    • Thread