• 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: Bindings & NSTableView: setting cell as 'editable' based on another property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings & NSTableView: setting cell as 'editable' based on another property


  • Subject: Re: Bindings & NSTableView: setting cell as 'editable' based on another property
  • From: Andrew White <email@hidden>
  • Date: Thu, 02 Jun 2005 14:49:49 +1000


Lee Morgan wrote:
How about binding the table column to something like...
Bind: "editable" (and / or "enabled")
Bind to: arrayController
Controller Key: arrangedObjects
Model Key Path: isActive

You can invert a boolean using the 'NSNegateBoolean' value transformer in the binding.

As for doing this per *cell* - as far as I know it isn't possible in IB. However if you bind your column as stated above, then each "cell" will have their own "isActive" variable - contained by the array.

I tried that.

NSTableColumn Info (bindings)

value = arrangedObjects.name [MyArrayController]
editable =
  NSNegateBoolean (arrangedObjects.isActive) [MyArrayController]

The entire column is set non-editable. This applies whether the first row isActive or not.


Update: tested things out. Turns out that the column as a whole needs to be set editable, at which point the editable / non-editable settings of the cells flow through.


Thanks for your help. :)

--
Andrew White

--------------------------------------------------------------------------
This email and any attachments may be confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
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


  • Follow-Ups:
    • Binding NSTableView Column Headers vs Cells (was: Bindings & NSTableView: setting cell as 'editable'...)
      • From: Tim Lucas <email@hidden>
References: 
 >Bindings & NSTableView: setting cell as 'editable' based on another property (From: Andrew White <email@hidden>)
 >Re: Bindings & NSTableView: setting cell as 'editable' based on another property (From: Lee Morgan <email@hidden>)

  • Prev by Date: Re: Bindings & NSTableView: setting cell as 'editable' based on another property
  • Next by Date: Custom objects in drag pasteboard?
  • Previous by thread: Re: Bindings & NSTableView: setting cell as 'editable' based on another property
  • Next by thread: Binding NSTableView Column Headers vs Cells (was: Bindings & NSTableView: setting cell as 'editable'...)
  • Index(es):
    • Date
    • Thread