Re: Validating a form
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