hi,
i'm creating some UILabels in my UIView, filling them with data, adding them to view and releasing them
UILabel *speed = [self scrollLabel:@"some Text" x:455.0f y:75.0f];
[scrollView addSubview:speed];
[speed release]; the method:
- (UILabel *)scrollLabel:(NSString *)text x:(float)x_ y:(float)y_ {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x_, y_, 300.0f, 20.0f)]; [label setText:NSLocalizedString(text,@"")]; [label setFont:[UIFont fontWithName:@"Helvetica" size:14]]; [label setTextColor:[UIColor colorWithRed:255.0 green:255.0 blue:255.0 alpha:1.9]]; [label setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0]];
return label;
}
i got a button, where the user can reload the data of the uilabels. im removing the parent view of all these labels from superfiew, generating the new data and doing the method where the labels are set, again.
the problem is, the old UILabels are still existing, so my question is, whats the best way to remove this special labels?
i made a loop and removed all subviews, the problem is, i also got some other subviews in there, which i dont want to delete.
another question: is there a better way to setup font-styles for multiple Labels?