·H
@interface ViewController : UIViewController {
IBOutlet UILabel *textview;
}
-(IBAction)random;
的.m
-(IBAction)random{
int text = arc4random() % 24;
switch (text) {
case 0:
textview.text = @"example 1";
break;
case 1:
textview.text = @"example 2";
break;
case 2:
textview.text = @"example 3";
break;
case 3:
textview.text = @"example 4";
break;
case 4:
textview.text = @"example 5";
break;
case 5:
textview.text = @"example 6";
break;
case 6:
textview.text = @"example 7";
break;
...等 我只是希望它不要像示例1,3,6,2,5,4,7或类似的东西重复,然后重复开始而不重复相同的事情两次,除非所有文本都已显示 提前谢谢