Xcode4.5.2でUIColorclearColorメソッドを使用すると、古いラベルテキストがクリアされません。新しいテキストが古いテキストに重ねられています。
これが私のコードです。再起動を押すたびに、ラベルを@""にリセットしたいと思います。しかし、それはクリアされていません。
CGRect frame=CGRectMake(intX, intY, 15, 18);
UILabel *label = [[UILabel alloc] initWithFrame:frame];
[self.view addSubview:label];
[label setFont:[UIFont fontWithName:@"ChalkboardSE-Light" size:17]];
CGRect frame1=CGRectMake(intSerialNoX, intY, 20, 18);
UILabel *label1 = [[UILabel alloc] initWithFrame:frame1];
[self.view addSubview:label1];
[label1 setFont:[UIFont fontWithName:@"ChalkboardSE-Light" size:17]];
label1.textColor = color;
label.backgroundColor=[UIColor clearColor];
label1.backgroundColor=[UIColor clearColor];
if([strAction isEqualToString:@"GO"])
{
[label1 setText:[myLableSerialNoArray objectAtIndex:i]];
[label setText:[[myLableWordsArray objectAtIndex:i] substringWithRange:NSMakeRange(j,1)]];
}
else if([strAction isEqualToString:@"RESTART"])
{
[label1 setText:@""];
[label setText:@""];
}