I want to add a bool to change a value îs favorite every time a button Is clicked. If the button is clicked in a different controller I want to add an object to an array. What I’m asking is how to add the code to the first controller to change the bool value. This is my first time working with a bool so If someone mentioned where to reference the bool in the header that would be appreciated.
Share
Um… So you want to know how to change a BOOL from true to false to true again every time a UIButton (button) is clicked? You should probably read up on programming then on the iPhone if this is your very first time working with a BOOL. But, what you need to do is set up an IBAction (for touch up inside) most likely. And then write in the code:
EDIT: Actually on second reading you want to do something if the button is pressed. For this all you need to do is set up an IBAction and connect to your button (probably touch up inside) and then do whatever you want in there.