• 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: 2 Beginner Bindings Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 Beginner Bindings Questions


  • Subject: Re: 2 Beginner Bindings Questions
  • From: Peter Zegelin <email@hidden>
  • Date: Wed, 3 Nov 2010 21:39:52 +1100

On 03/11/2010, at 8:02 PM, Peter Zegelin wrote:

>>>
>>> My other question is related. I would like to enable the delete button only if there is a selection in the table. Again, I have tried binding the enabled property of the button to the controller with various combinations of Controller Key and Model Key Path, with no luck.
>>
>> Bind the enable state of the button to the "canRemove" property of the array controller. Note that it's actually inherited from the superclass, NSObjectController, which is probably why you didn't find it.
>>
>>
>
> Tried that and it didn't work. The button never disables/enables with the selection and pressing it removes the first object in the array even if not selected. When the last object is removed *then* the button disables.

I discovered the following works:

Bind the button enabled binding to the ArrayController.
Controller Key = selection
Model Key Path is left blank
Value Transformer = NSIsNotNil


cheers,

Peter_______________________________________________

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: 
 >2 Beginner Bindings Questions (From: Peter Zegelin <email@hidden>)
 >Re: 2 Beginner Bindings Questions (From: Quincey Morris <email@hidden>)
 >Re: 2 Beginner Bindings Questions (From: Peter Zegelin <email@hidden>)

  • Prev by Date: Re: 2 Beginner Bindings Questions
  • Next by Date: [iPhone] HTTPS / client Certificate / configuration profile
  • Previous by thread: Re: 2 Beginner Bindings Questions
  • Next by thread: UITouch's function locationInView not working with iOS4.2
  • Index(es):
    • Date
    • Thread