make "OK" pressable when the following conditions are met

For my cd-key project i was wondering if you could make it so that an OK button could not be pressed unless some conditions are met
also is is possible to do default buttons in xcode?
Thanks in advance

The answer is yes, but it depends on what you want the conditions to be. For example it could be disabled if a check box is not selected or some text is not validated in a text box.
But if you want more that this, please describe in more detail what your conditions are.