• 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
Binding directly to instance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding directly to instance


  • Subject: Binding directly to instance
  • From: Jeff LaMarche <email@hidden>
  • Date: Tue, 3 Jan 2006 11:14:12 -0500

In my experimentation with Cocoa Bindings, I've encountered something that I think is a bug, but it might be that I'm simply not grokking the way it all works.

On several occasions, I've needed to bind directly to a key or action of an object instance contained in my nib. One recent example I can think of was to bind the doubleClickTarget of a table view to a method of my controller instance (old-fashioned generic controller, not an NSController subclass). When I bind to my controller instance, it says that model key path is required, but I want it to fire the selector right on the object I'm binding to. I tried creating a workaround accessor that returned self, but that crashed.

I've run into the same problem with trying to populate NSPopupButtons directly from an NSArrayController using the content binding (along with contentValues and selectedValue). According to the binding docs, you need to bind content to an array controller, but if your array controller is an instance in your nib, rather than an attribute or iVar of an instance in your nib, it requires you to specify a controller key, so binding directly to the array controller is impossible. Again, typing a controller key of 'self' does not work.

I feel like either I'm missing something, or else that I should be filing a bug report on this, but wanted to just make sure it wasn't the former before I went and did the latter. =-)

Thanks much,
Jeff
_______________________________________________
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


  • Prev by Date: Re: Dragging Images Outside an NSTextVIEW
  • Next by Date: Re: Persistent ZeroLink
  • Previous by thread: Re: Persistent ZeroLink
  • Next by thread: Re: Binding directly to instance
  • Index(es):
    • Date
    • Thread