[textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
//显示文本框内输入的文字
- (void)textFieldDidChange:(UITextField *)textField
{
if (textField.text.length > 11)
{
textField.text = [textField.text substringToIndex:20];
}
}