Basically I want to create 48 button outlets. I have created the buttons in the interface builder and I want to be able to connect them to the outlets.
I need to be able play a sound when I press one of the buttons. But the sound file that is played should be customizable.
I want smth like:
//first create the outlets
for(int i=1;i<49;i++){
IBOutlet UIButton [Nstring of type (@"but%d"), i];
[add butt"i" to array];
}
//then connect the outlets to the buttons
//listen for buttons pressed
while(1){ //or the listener equivalent don't know exactly how i works
for(int i=1;i<49;i++){
if(array[i].pressed==TRUE){
//if button is pressed play the according file
playsound(sounds[i]);
}
}
}
I need to be able to easily change the file that is played Thank you