I have a problem here. I'm creating UILabels dynamically to be displayed into a UIView. Here is the code:
for (flower in flowerList)
{
// Create the Qty label
CGRect rectQty = CGRectMake(x , y, 25, labelHeight);
UILabel *flowerQuantityLabel = [[UILabel alloc] initWithFrame:rectQty];
NSString *fQty = [[NSString alloc] initWithFormat:@"%d", flower.flowerQty];
[flowerQuantityLabel setText:fQty];
// Loading refrence into a array
// here is the problem
[flowersQtyLabels addObject:flowerQuantityLabel];
// Create the name label
CGRect rectName = CGRectMake((x+offset) , y, labelWidth, labelHeight);
UILabel *flowerNameLabel = [[UILabel alloc] initWithFrame:rectName];
[flowerNameLabel setText:flower.flowerName];
y = y + 40.0;
[self.view addSubview:flowerQuantityLabel];
[self.view addSubview:flowerNameLabel];
}
I hope some one can help me.
I had the NSMuttableArray
not initialized properly.