Hi.
New to Obj-c.
Is there a way to declare UI objects such as buttons, so that i can access and manipulate them by an index (based on tag) instead of needing unique names for each? I am particularly interested where I want to change a button's titlecolor based on some condition.
Example:
Instead of:
UIButton *btn1, *btn2, *btn3,...*btn10;
...
//Then use corresponding tag for each in code:
-(IBAction) buttonPressed

UIButton *)sender
{
switch ([sender tag])
{
case 1: if (btn1 meets some condition)...;break;
case 2: if (btn2 meets some condition)...;break;
case 3: if (btn3 meets some condition)...;break;
...
case 10: if(btn10 meets some condition)...;break;
}
}
...Is it possible to set up multiple instances of btn, i.e., declare btn(10) so that I can do this, where the button's tag is used as an index:
-(IBAction) buttonPressed...
{
if (btn([sender tag]) meets some condition)...;
}
Thanks!
Al