user1075871
user1075871

Reputation: 75

make textfield become first responder

In my table I use UITextField istead of UILabel (with enabled = 0).

Now pressign an add button, the last cell shall become editable. I tried the following:

UITextField *textField = [subviewsOfCell ObjectAtIndex:index];
[textField becomeFirstResponder];

but I doesn't get it editable. (I know that I get the correct cell, because textField.text = @"test"; displays correctly). What must I do?

Upvotes: 0

Views: 1361

Answers (1)

Mihai Fratu
Mihai Fratu

Reputation: 7663

Just try doing this:

UITextField *textField = [subviewsOfCell ObjectAtIndex:index];
textField.enabled = YES;
[textField becomeFirstResponder];

Let me know if that works for you.

Upvotes: 2

Related Questions