カウント アニメーションを作成します。次のように、ラベル テキストの値を含む整数を作成したいと思います。ラベルに数字が表示されている場合、整数は 1 に等しくなります。どうすればよいですか。 ? ここに私のコードがあります:
-(void)countup
{
count = 1;
MainInt += 1;
numbersLabel.text = [NSString stringWithFormat:@"%i", MainInt];
NSLog(@"%d", count);
}
-(void)viewdidload
{
[numbersLabel setOutlineColor:[UIColor whiteColor]];
[numbersLabel setGradientColor:[UIColor blackColor]];
numbersLabel.drawOutline = YES;
numbersLabel.drawDoubleOutline = YES;
numbersLabel.text = @"start";
//numbersLabel.font = [UIFont fontWithName:@"Ballpark" size:220];
numbersLabel.font = [UIFont fontWithName:@"Arial" size:220];
MainInt = 1;
numbersTimer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(countup) userInfo:nil repeats:YES];
}
ありがとう!