I am using a timer in xcode i have managed to make it count down correctly but when counting down it goes into negatives,
i have tried using an if statement to counter this but it dosnt seem to work here is the code i am using,
IBOutlet UILabel *timelabel;
int MainInt;
NSInteger fred;
NSTimer *timer;
MainInt -= 1;
timelabel.text = [NSString stringWithFormat:@"%i",MainInt ];
MainInt = 20;
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countdown) userInfo:nil repeats:YES];
if (timelabel.text <= @"0")
{
[timer invalidate];
timelabel.text = @"20";
}
the H is ov my H