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
Post a Comment