views:

35

answers:

1

I have a xib. the xib has a button that swaps another xib.

the second xib has a uitextfield and a uilabel.

how do I make the keyboard go away when I'm done typing? what do I need to wire or code? the second xib has it's own class (called CustomSign.m)

Inside CustomSign.m, I've implemented the following method

-(void)textFieldDidEndEditing:(UITextField *)textField {
[customText resignFirstResponder];
signedLabel.text = customText.text;
}

- (void)awakeFromNib
{
//assume textField is an ivar that is connected to the textfield in IB
[customText setDelegate:self];
}

I get the following warning

Class "CustomSign" does not implement the UITextFieldDelegate protocol

+2  A: 

To remove warning you need to specify in your CustomSign class declaration that it conforms to UITextFieldDelegate protocol:

@interface CustomSign: UIViewController<UITextFieldDelegate>
...
Vladimir