objective c - UitextField resignFirstResponder does not work in scroll view -


i have 2 functions resignfirstresponder neither of them works when textfields in scrollview

my functions:

-(bool)textfieldshouldreturn:(uitextfield *)thetextfield {          if (thetextfield == textfield1) {         [textfield1 resignfirstresponder];     }     if (thetextfield == textfield2) {         [textfield2 resignfirstresponder];     }     if (thetextfield == textfield3) {         [textfield3 resignfirstresponder];     }       return yes;  }  - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event {     uitouch *touch = [[event alltouches] anyobject];     [textfield1 resignfirstresponder];     [textfield2 resignfirstresponder];     [textfield3 resignfirstresponder];  } 

i have linked scroll view in ib, can not find out why not works there when click outside of scrollview.so responds view, why?i thougth [[event alltouches] anyobject] respond alltouches @ anyobjects

thanks help

wouldn't bit more elegant add transparent view inherits uicontrol size equal scroll view of , create ibaction new view?


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -