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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -