• 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: Binding questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding questions


  • Subject: Re: Binding questions
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 10 Nov 2004 14:31:06 -0800


On Nov 10, 2004, at 1:40 PM, Scott Stevenson wrote:

1) I have table with a check box column bound with a NSArrayController. I
also have a "Check All" button. Is it possible to bind it. If so, what is
the best way of doing it?
Such a checkbox doesn't represent a single piece of data, so a binding doesn't really make sense.

Umm, actually you can bind the value of a single check box to [Controller].arrangedObjects.<checkAttribute> and when you click it it will do the Right Thing.

It looks like by default it (the solo check box) doesn't show mixed state, though, so you might have to wrestle with your conscience over the aesthetics -- and perhaps file a bug report.

Attach it to an action that loops through your array of objects and sets the checked state on each.

You can do this in one line with KVC:
	[theArray setValue:aNumber forKey:@"<checkAttribute>"];

mmalc
_______________________________________________
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:
    • Re: Binding questions
      • From: Tim Lucas <email@hidden>
References: 
 >Binding questions (From: Eric Forget <email@hidden>)
 >Re: Binding questions (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Why "Add" button for Cocoa Bindings?
  • Next by Date: auto InfoPlist.strings updating
  • Previous by thread: Re: Binding questions
  • Next by thread: Re: Binding questions
  • Index(es):
    • Date
    • Thread