How to create a piano-style interface on an iPhone? [duplicate]
Assume you are writing a code for a piano instrument. Is a good way to make for every button IBAction or all buttons i开发者_StackOverflow中文版n one function return the sound clicked by the user?
It would be much easier to maintain by going with the latter: having all of the buttons point to one IBAction
, and the IBAction
plays a given note based on which button was pressed rather than having a one-for-one relationship between buttons and IBActions
.
精彩评论