title: How to automatic call function every x time
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1053585/how-to-call-function-in-every-x-minute">How to call function in every &ldquo;X&rdquo; minute?</a>  </p>
  </blockquote>
  
  
  
  <p>How to periodically call a certain function?</p>
  
  <pre><code>- (void)viewDidLoad
  { 
      [super viewDidLoad];
      [self checkAlert];   
  }
  
  
  
  -(void)checkAlert{
      // Server output Alert Note
      NSString *alert_note_hostStr = @"http://www.loxleyintranet.com/MobileApplication/xml/alert_note.php";
      NSData *alert_note_dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:alert_note_hostStr]];
      NSString *alert_note_serverOutput = [[NSString alloc] initWithData:alert_note_dataURL encoding:NSASCIIStringEncoding];
  
      if ([alert_note_serverOutput isEqualToString:@"0"]) {
          alertImage.hidden = YES;
          alertLabel.hidden = YES;
          underMainBG.hidden = YES;
          alertLabel.text = [NSString stringWithFormat:@"No Alert"];
      }else{    
          alertLabel.text = [NSString stringWithFormat:@"You've Got Note (%@)" ,alert_note_serverOutput];
  
      }    
  }
  </code></pre>
  
  <p>How can I call <code>[self checkAlert];</code> every <code>x</code> minutes or seconds?</p>