ios - Referring to buttons by their tag but not in its action -


so, i'm new this. anyway, have 36 buttons connected 1 action references them tag. later in application, when button not 1 36 pressed, want disable 36 buttons. possible?

yes, possible. use enabled property.

since have tags, can reference each 1 [self.view viewwithtag:tag]

so example let's tags 1 thru 36. then:

for (int = 1; < 37; i++)      [[self.view viewwithtag:i] setenabled:no]; 

if want omit particular button being disabled you'll need modify logic. i'm showing general idea.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -