NSTimer Not Stopping When Invalidated

后端 未结 7 1343
情书的邮戳
情书的邮戳 2021-01-05 05:22

I have the following code in my .h file:

#import 
#import 
#import 

        
7条回答
  •  梦毁少年i
    2021-01-05 05:43

    Have you try to put repeat as No

    self.messageTimer = [NSTimer scheduledTimerWithTimeInterval:10.0
                                                                 target:self
                                                              selector:@selector(checkForMessages)
                                                               userInfo:nil
                                                                repeats:NO];
    

提交回复
热议问题