views:

70

answers:

2

I don't think I am creating this array of UILabels correctly.

If I put a breakpoint after this line of code, it shows that the array is empty.

 colorLabelArray = [[NSMutableArray alloc] initWithObjects:  greenLabel, orangeLabel, blackLabel,purpleLabel, yellowLabel, redLabel, blueLabel, whiteLabel, nil];

If I do the same thing with UIImages it works just fine. What am I missing?

+3  A: 

Your syntax is fine. I would check if greenLabel is nil?

Cannonade
+5  A: 

Are you certain that none of the label objects are nil? Specifically, if greenLabel is nil, then initWithObjects: will ignore the rest of the argument list and return an empty array.

benzado
Yes, that was exactly it. Thanks.
AaronG