when i am pressing my UIButton ,(i did not release my mouse button),i want to change title? i tried touchupinside through XIB.but it was called after i released my mouse button. i tried both land also all states....? [sButton setTitle:@"hai" forState:UICo开发者_Python百科ntrolStateNormal]; [sButton setTitle:@"hai" forState:UIControlStateHighlighted];
The Control Events documentation will list all of the events you can subscribe to for controls (in this case, your UIButton
). The one you want is UIControlEventTouchDown
. But the problem with your requirement is that pushing the button covers the screen with the user's finger and I wonder whether changing the title will really be beneficial.
精彩评论