So in my iPhone app I’m building, I have two buttons that are going to be designated for “Choice 1” and “Choice 2” for the users to select their date and time (for ex. to schedule an appointment).
Choice 1 has an ActionSheet to display the date, and is set to where when the user taps “Selected”, it automatically goes to the other method I have which displays two times that are programmed in (As NSArray classes).
What my question is, I want to keep those two methods, but use a method called “button1Clicked” calling both, and do the same for “button2Clicked”. Any ideas? I’ll be more than willing to supply code that I have existing. Thanks!
I couldn’t find this already answered but if someone knows if this is indeed answered on the site here can you supply a link? That would be appreciated!
Go easy please, I’m still a beginner 🙂
Can you clarify your question. Are you asking how to write a method which contains calls to other methods? Or are you asking how to hook up a method to be called upon a button press? Or are you asking how to have both buttons call different methods, which methods then call the two first mentioned methods?
For one method to handle multiple buttons:
Approach A:
Approach B: