Is there a way to handle all actions off of a UIToolbar?
Is there a way to use actions and selectors from Interface Builder to bind handlers to a UIToolbar? Rather than enumerating the UIButtonBarItems and adding action selectors to each one at a time, I was hoping I could just implement a single method in my Controller, that would handle all of the buttons and handle the events by switching on either button's Tag or I开发者_如何学JAVAdentifier.
You are free to connect as many bar buttons as you like to the same IBAction
method in Interface Builder. In the method, you can use the sender
argument to see which button was tapped.
精彩评论