Question: i have a table with all the students names and another table with student name and their enrollments in classes i want to show both students with their class names even if they are not enrolled in any classes i used union between the enrolled and not enrolled the only problem that the names are duplicated 

Student (student\_id, student\_name, major, level, age)
Enrolled (student\_id, class\_name, semester)

and here's the MySQL query:

select student\_name,class\_name from student natural join enrolled union select student\_name,null as class\_name from student group by student\_name;

Answer: 
in viewDidLoad

```
self.timderReminder = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                   target: self
                                                     selector:@selector(reminderForVideoPlayer:)
                                                     userInfo: @{@"boolType":@"YES"} repeats:YES];

```

and

```
-(void)reminderForVideoPlayer:(NSTimer *)userInfo
{
    NSString *isVideoAdvertisement = [userInfo.userInfo objectForKey:@"boolType"];
    NSLog(@"NSTimer info = %@",userInfo.userInfo);

    if([isVideoAdvertisement isEqualToString:@"YES"])
    {
        if(remind < 5)
        {
            [labelReminder setText:[NSString stringWithFormat:@"Reklami geç: %d",5-remind]];
            NSLog(@"reminder window = %d",remind);

            [labelReminder setHidden:NO]; 
        } else {
            [labelReminder setHidden:YES];

            // [window addSubview:myButton]; //add this button in view did load only over here use setHidden method
            [myButton setHidden: NO];
        }
}

```

Try with this code.
Change the `repeats` parameter of NSTimer to `YES`. And you won't have to create a timer again each time it's fired. When your counter reaches to 5, just `invalidate` your timer.