objective c - UIButton not responding to 'touchUpInside' but will respond to 'touchDown' fine -


in program, have uibutton declared programmatically property of uiviewcontroller. have set send actions when user triggers touchupinside event, shown here:

[restartbutton addtarget:self action:@selector(handlerestart) forcontrolevents:uicontroleventtouchupinside]; restartbutton name of uibutton.

when enter uicontroleventtouchdown in forcontrolevents parameter, works fine. however, uicontroleventtouchupinside not work. know why is?

you may want check restartbutton.bounds. may have set size of 0 causing uicontroleventtouchupinside never occur. best way of checking add borders layer.

[restartbutton.layer setborderwidth:1.0f]; [restartbutton.layer setbordercolor:[uicolor redcolor].cgcolor]; 

don't forget #import <quartzcore/quartzcore.h> above work


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -