iOS 產生隨機亂數1~100
-(IBAction)generateNumber:(id)sender {
int number = (arc4random()%100)+1; //Generates Number from 1 to 100.
NSString *string = [NSString stringWithFormat:@"%i", number];
label.text = string
NSString *string = [NSString stringWithFormat:@"%i", number];
label.text = string
}
留言
張貼留言