Ajuste el rango seleccionado a todo el texto de la Textview primera:
[textView setSelectedRange:NSMakeRange(0, textView.text.length)];
[textView setText:@""];
Como en:
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView {
// Make the textView visible in-case the keyboard has covered it
[table scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]
atScrollPosition:UITableViewScrollPositionTop
animated:YES];
// Keyboard toolbar prev/next buttons
[nextPreviousControl setEnabled:YES forSegmentAtIndex:0];
[nextPreviousControl setEnabled:NO forSegmentAtIndex:1];
//
// Erase all text in the textView before editing starts:
//
[textView setSelectedRange:NSMakeRange(0, textView.text.length)];
[textView setText:@""];
return YES;
}
Agregue NSLog (@ "Text Field Content:% @", textField.text); después de la primera línea, ¿cuál es la salida? ¿Creó textField mediante programación o utilizando el constructor de interfaz? – 0x8badf00d
Lo siento. Es textView, no textField. Yo edité Creé textview programmatically. – user698200