2014-03-13 73 views

回答

4

你需要當用戶按文本字段來檢測,所以用這個方法:

- (void)textFieldDidBeginEditing:(UITextField *)textField{//detect that user press the field 
    if ([textField.inputView isKindOfClass:[UIPickerView class]]) {//in case the input is uiPickerView 
     if ([textField.text isEqualToString:@""]) {//and the field is empty 
     //set your data here like: textField.text= your default value; 

} 
相關問題