title: Set UIAlert to appear after x amount of IBAction presses
body: <p>Is there a simple way of setting a piece of code to check for a certain amount of presses before using a UIAlertView,</p>
  
  <p>For example,</p>
  
  <p>If the IBAction has been pressed 30 times, then we would like to show a UIAlertView, I can do the Alert, it's just the figuring how to count 30 presses?</p>
  
  <p>Thanks to you both, I have gotten a little further, here is the code, I am using count as the int here;</p>
  
  <p>It works, but the aim is that if the user has purchased the upgrade then the count is ignored... At the moment, even if the user upgrades, they still get that UIAlert on every 30 presses</p>
  
  <pre><code>- (IBAction)setRandomText {
  
      selectedRecNumber = (arc4random() % kMaxRecords);
      NSString *text = [allText objectAtIndex:selectedRecNumber];
     [randomText setText:text];
      count++;
  
      if (![MKStoreManager featureBPurchased] ) {
  
          if(count == 30)
          {
              count = 0;
  
          UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Limit" message:@"Reached the Limit!" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"OK",nil];
          [alert show];
          [alert release];
  
  
      }else{
  
      }
  }
  
  }
  </code></pre>
  
  <p>--- EDIT fixed using this method;</p>
  
  <pre><code>   if (kMaxRecords == 35) {
  
              if(count == 30)
              {
                  count = 0;
  
  }else{
  
  }
  
  }
  </code></pre>