I’m doing an iPad app in Xcode 4.3
So, I am triggering a function and inside that function, I want to be able to alter the characteristics of other buttons. For example, upon clicking my button (that I made in Interface Builder) linked to the function, I want to have a load of other buttons (also in IB) change text/color.
I’ve tried the developer book and a good amount of time on google, but I can’t find the question asked or answered in the way i’m trying to phrase it (I decided this was the most clear one in the end)
I know I can easily edit the name of the button I’ve used to call the function
[MYBUTTON setTitle:(NSString *) TITLE forState:(UIControlState) STATE];
but I can’t figure out how on earth to edit other buttons I’ve added in the interface builder. Is this possible, or do I need to deal with the buttons more programmatically?
so far in my function, I’ve called the IBAction and made a load of tags to relate to the buttons that I want to change – am I heading along the right road?
Hope this is clear about what I’m trying to achieve, and be gentle with me, my objective C isn’t that good yet!
You can mark button properties or instance variables with the IBOutlet marker and then hook the buttons in Interface Builder up to your object.
Also, it isn’t a good idea to have all capital letter variable names. In C convention, those are usually reserved for preprocessor macros.