project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m
branchios-revival
changeset 11206 2e80c9861818
parent 11119 f08d5bb1d2b0
child 11218 08f20ffa5801
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Wed Oct 14 02:28:32 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Wed Oct 14 21:25:49 2015 +0200
@@ -54,7 +54,7 @@
 }
 
 -(void) viewWillAppear:(BOOL)animated {
-    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:random()%[self.listOfMissions count] inSection:0];
+    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:arc4random_uniform((int)[self.listOfMissions count]) inSection:0];
     [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
     [self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
     [super viewWillAppear:animated];