1.) send the variable dice to the UILABEL
2.) Two seconds later it will clear the text on the label.
This is how I have gotten this accomplished.
I have an IBACTION called randomNumber that I have linked to the button in my project.
-(IBAction)randomNumber {
int dice = 1 + arc4random() % (20);
label.text = [NSString stringWithFormat:@"%d", dice];
// perform selector after delay
[self performSelector:@selector(ClearLabel) withObject:nil afterDelay:2];
}
- (void)ClearLabel
{
label.text = @"";
}
This code has been test in XCODE 3.2.3 and IPHONE SDK 4.00.
If anyone has a better way of doing this please send an e-mail to timbojill@gmail.com. I do not read comments left behind by users
This code has been test in XCODE 3.2.3 and IPHONE SDK 4.00.
If anyone has a better way of doing this please send an e-mail to timbojill@gmail.com. I do not read comments left behind by users
No comments:
Post a Comment