iphone - disable uibutton whilst still pressed? -


is possible disable uibutton whilst tapped user?

i use nbtouchandholdbutton , in method want button disabled when number reached.

i.e

//......     [touchandholdbutton addtarget:self action:@selector(countnumbers:) fortouchandholdcontroleventwithtimeinterval:0.2];  //.....  -(void) countnumbers {  [self countthenumbers];  if (currentnumber == 10) {         touchandholdbutton.userinteractionenabled = no;          }  } 

so while holding button down when number 10 reached want button disabled , ignore touches point on. in example above button still receives input user until user lifts finger. goes disable. possible?

//..........  [self.btnobj addtarget:self action:@selector(countnumbers) fortouchandholdcontroleventwithtimeinterval:0.2];  //..............  -(void) countnumbers {     if (currentnumber == 10) {         self.btnobj.userinteractionenabled = no;         return;     }     [self countthenumbers]; } -(void)countthenumbers{     currentnumber++; } 

try this.hope helps you.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -