Background: I am creating a music app that gets data from my piano keyboard through CoreMIDI. When a note is played, it relays this to the GUI by showing the onscreen keyboard key as being pressed. The onscreen keyboard is represented by UIButtons for now. Each "key" (UIButton) has an identifier that corresponds to the MIDI value from my physical piano keyboard. For instance, middle C's UIButton will have a value of 60, since that is the value returned in MIDI data. C# is 61, D is 62, etc.
Question: How can I access all of the UIButtons from my window programatically? I need to access them by their "identifier" field, unless there's a more elegant way to do so. I haven't been programming for OSX for very long (actually only a few days) and I've literally watched about 100 videos on YouTube so I'm still learning. I have read a few posts that have said each UIButton is a subview of the main view. I couldn't figure out how to access the buttons via code though. Whatever suggestions you have will be very helpful! Thanks in advance.