I’m building calculator on the iphone for learning purposes.
I have a situation where I have multiple buttons that are Operations(+,-,/) and multiple buttons that are Operands e.g. 1,2,3 etc.
So all the the Operations connect to a operationPressed method in my viewController.
Is there a way in the UI builder to identify each UIButton other than using the Text for the button in the view?
What would be best practice?
Update
What about the Identity Label that I can set in the UI builder. can I reference that?
The reason I ask is I want to identify the button but say ‘/’ but the text on the button would be ‘÷’ so that is why i need some other string identifier which ultimately can be pass as an argument to my model.
http://cl.ly/3H1j032f1M1d3A2Y3501
The way this is typically handled is to set each button’s
tagproperty to some unique integer value, and write action methods that take asenderargument, for example:EDIT
Here’s the declaration of the
tagproperty fromUIView.h: