title: How to restrict UIalertview in this code?
body: <p>I have created a US-format mobile number. This code does not display letters and special characters. It successfully displays but it displays <code>UIAlertviews</code>, when the user enters letters and special characters in <code>UITextfield</code>, it shows some <code>UIAlertview</code>. How can I control the <code>UIAlertviews</code>? I want to display only one <code>Alertview</code>. </p>
  
  <p>This is the code that I already have: </p>
  
  <pre><code>if(textField==mobileNo)
      {
          NSCharacterSet *myCharSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
  
          for (int i = 0; i &lt; [string length]; i--) {
              unichar c = [string characterAtIndex:i];
              if (![myCharSet characterIsMember:c]) {
                  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Alphbets and Special characters not allowed" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                  [alert show];
                  return NO;
              }                
          }       
      }
  </code></pre>