• 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: Validating a form
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Validating a form


  • Subject: Re: Validating a form
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 23 Oct 2009 18:50:31 -0700

On Oct 23, 2009, at 1:49 PM, Timothy Reaves wrote:

> 	Again, I wanted to know, in IB, what I needed to do to enable or disable an OK button, based on values in a form.

Connect the “enabled” binding of your OK button to a BOOL property — call it “canAccept” — of the controller you’ve created to manage your sheet.

When its validation needs aren’t met, your controller needs to set its canAccept to NO in a KVO-compliant fashion.  When its validation needs are met, it needs to change this to YES, again in a KVO-compliant fashion.

>  Whereas I know bindings can be handled programmatically, I prefer to do them in IB.  The document you referenced tells me which bind - in IB - to create.

Just because you create the binding in Interface Builder rather than code does not make this any less a Cocoa question.

If you want to follow up further, let’s take this to Cocoa-Dev.

  — Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Validating a form
      • From: Sherm Pendley <email@hidden>
References: 
 >Validating a form (From: Timothy Reaves <email@hidden>)
 >Re: Validating a form (From: Fritz Anderson <email@hidden>)
 >Re: Validating a form (From: Timothy Reaves <email@hidden>)
 >Re: Validating a form (From: Sherm Pendley <email@hidden>)
 >Re: Validating a form (From: Timothy Reaves <email@hidden>)

  • Prev by Date: Re: Validating a form
  • Next by Date: Re: Validating a form
  • Previous by thread: Re: Validating a form
  • Next by thread: Re: Validating a form
  • Index(es):
    • Date
    • Thread