Edit UIButton text with keyboard
I have a UIButton that responds to a TouchUpInside ev开发者_StackOverflowent. Inside this event handler, I want to bring up the keyboard and allow the user to edit the text of the button. I have tried to set editing to YES as shown below, but this gives an unrecognized selector message...
-(void)editSelection:(id)sender
{
[sender setEditing:YES];
}
Is there a way to edit text if the sender is a UIButton?
best set a text field over the button ( a borderless one) -
and then [self.myVeryOwnButton setTitle:@"something" forControlState:UIControlStateNormal];
something of that nature.
I ended up creating a UITextField with the same frame as the button.
精彩评论