Because of some rendering issues with UITextViews, I am dynamically creating UILabels for each of the UITextViews in my scene, and using renderInContext to make an image. Works perfectly, except that I need to remove the labels after the render, else they will re-render next time I execute the renderInContext. I am using removeFromSuperview to try remove the labels, but they are not “releasing” they just accumulate with each render, and they do re-render in some cases. How can I get rid of the labels so they will not re-render?
for (i = 0; i < [labelsArray count]; i++) {
[[labelsArray objectAtIndex:i] removeFromSuperview];
NSLog(@"label: %@", [labelsArray objectAtIndex:i]);
If they are still in your array, they are still retained. if you want them to be released, you’ll have to remove your label from your array.
Try to set a UILabel pointer on it , remove it from superview and array, then display it.
It should be released