• 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: Another bindings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another bindings question


  • Subject: Re: Another bindings question
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 03 Jun 2015 00:38:05 +0000

On Jun 2, 2015, at 17:18 , John Brownie <email@hidden> wrote:
>
> What I have is an NSTableView (still cell-based, moving to view-based is further down the track), and then a bunch of buttons that need to be enabled only when there is a selection in the table. Binding to the selection property of the array controller with NSNotNil doesn't work. Binding to selectionIndexes.count (which works as 0 or 1) does work, but this is the binding where I get the exception. Finding that binding was trial and error, as I haven't really found a good guide to this whole area, so I would be happy to have a better solution.

The most straightforward property to bind the button enabled state to is “canRemove”. (It just means something is selected.) It’s easy to miss because it’s actually defined in the parent class (NSObjectController), *and* it’s apparently missing from the class documentation. However, it’s still documented in NSObjectController.h, so it’s really available.

This probably won’t solve your problem. More likely you’ve a place where a non-owning reference (weak or unretained, such as for a delegate) is still pointing to an invalid object. In some cases, you need to nil out delegate references when tearing down your object graph.



_______________________________________________

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


  • Follow-Ups:
    • Re: Another bindings question
      • From: John Brownie <email@hidden>
References: 
 >Another bindings question (From: John Brownie <email@hidden>)

  • Prev by Date: Re: Looking at self = [super init].
  • Next by Date: Re: Looking at self = [super init].
  • Previous by thread: Another bindings question
  • Next by thread: Re: Another bindings question
  • Index(es):
    • Date
    • Thread