我想从 10 倒计时到 0。并且 em 用这段代码来做这件事。但它不能正常工作
-(void)elapsedTime
{
static int i = 11;
UILabel *label;
label = [[UILabel alloc] initWithFrame:CGRectMake(850, 27, 50, 50)];
label.textColor = [UIColor redColor];
label.font = [UIFont boldSystemFontOfSize:25.0f];
label.backgroundColor=[UIColor blackColor];
label.text = [NSString stringWithFormat:@"%i",i];
[self.view addSubview:label];
i--;
if(i<0)
{
[aTimer invalidate];
aTimer = nil;
}
[label sendSubviewToBack:self.view];
}