iOS UITextField限制输入长度

  if (textField == self.putInTextField) {
        if (textField.text.length > self.dataModel.peoplenum.length) {
            textField.text = [textField.text substringToIndex:self.dataModel.peoplenum.length ];
        }
    }

你可能感兴趣的:(iOS UITextField限制输入长度)