tags:

views:

172

answers:

1

I have an IBOutlet assigned in my header file named *myButton and is type UIButton class.

the purpose of myButton is to programmatically assign the alpha to multiple buttons.

it seems as if you can only assign myButton to one button in IB.

is there a way to assign an alpha value to multiple buttons at the same time or am i going to have to refer to each button. ive got quite a few buttons and i need them all to change at the same time.

thanks for any help!

+1  A: 

An IBOutlet is simply an instance variable (which is a pointer) in your class. You cannot have a pointer refer to more than one memory space simultaneously in any programming language.

You will need to refer to each button individually. You could look into storing pointers to all your buttons in an NSArray and simply iterating over it. You could also look into using an NSMatrixView or NSCollectionView to display your many buttons, and then take action on that to change all your buttons.

Marc W
darn. i thought being an instance variable was probably limited to one button. i will look into the nscollectionview. probably just refer directly for today. there are 20 buttons. just seemed to simple of an approach to list them all with alpha value. thanks for your quick reply!
Abbacore
Please accept this answer by clicking the green checkmark to its left if it helped you with your problem. And welcome to StackOverflow. =)
Marc W