ios - How to set state of UIButton in function -


i have loop loops through array of object type note has property fingering set button.

the loop:

for (int = 0; < [bb_major.scalenotes count]; i++) {         valve1.highlighted = no;         valve2.highlighted = no;         valve3.highlighted = no;         valve4.highlighted = no;          [scale tutorial:valve1 :valve2 :valve3 :valve4 :bb_major.scalenotes[i]];  } 

the tutorial method:

+(void)tutorial:(uibutton *)button1 :(uibutton *)button2 :(uibutton *)button3 :(uibutton *)button4 :(note *)note {  switch ([note.fingering count]) {     case 0:         break;     case 1:         button1 = note.fingering[0];          button1.highlighted = yes;          sleep(1.0);          break;     case 2:          button1 = note.fingering[0];         button2 = note.fingering[1];          button1.highlighted = yes;         button2.highlighted = yes;          sleep(1.0);          break;     case 3:         button1 = note.fingering[0];         button2 = note.fingering[1];         button3 = note.fingering[2];          button1.highlighted = yes;         button2.highlighted = yes;         button3.highlighted = yes;          sleep(1.0);          break;     default:         break; } } 

i have when loop iterates through scalenotes, each sequence of buttons highlighted moment, next notes buttons highlighted. there more efficient way accomplish task?


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -