If I link an IBAction to multiple buttons, if multiple calls to this IBAction where done simultaneously would it cause interference or a crash. Will each one have to wait for the other, or is it concurrent?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
User interface events (button presses, etc.) are processed one-by-one by the main thread. Unless you are specifically calling your IBAction method from multiple threads, it will not be executed simultaneously. In other words, actions triggered by user interface events are run sequentially. Each action will complete before the next begins.
There is no need to write separate (but identical) methods for your buttons because the event-by-event processing of the main thread will ensure that the action method is called sequentially, once for each button press. If you write a separate action method for each button, those action methods will still be executed one at a time.