Hi
I have a UIImageView object that is just a plain black rectangle. This is what i use to select a button in the view.
Problem is, I have 49 of these buttons in my view, and all of them can be selected at the same time.
What I use for adding a subview to a button is:
UIImageView* selectedSquareView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,40,40)];
[selectedSquareView setImage:[UIImage imageNamed:@"SelectedSquare.png"]];
[button addSubview: selectedSquareView];
I would like the selectedSquareView to be reused multiple times as subviews for the other buttons, but only keep one allocation of it. I would prefer not having 49 UIImageViews created at the same time just for this purpose. Is this possible?
If not, should I store them in a NSMutableArray for easy removal later?
Regards
-Raymond