title: Only allow letters and numbers for a UITextField
body: <p>I have a signup view controller where the user needs to enter an email address, a username, and a password.</p>
  
  <p>For the username and password fields, right now you can currently sign up with a username like "user%$&amp;" and a password like "password%^&amp;$". I don't want people to be able to use these special characters.</p>
  
  <p>I want to make it so that the username and password fields can only be submitted with alphanumeric characters aka letters and numbers. I have found some methods to do this, but they are confusing and I need this to work specifically with my code.</p>
  
  <p>Here is some of the code that I perform when a user has entered an email, username, and password and they press the submit button:</p>
  
  <pre><code>NSString *user = [_usernameEntry text];
  NSString *pass = [_passwordEntry text];
  NSString *email = [_emailEntry text];
  
  self.userSubmittedUsername = user;
  
  if ([user length] &lt; 4 || [pass length] &lt; 4) {
  
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Invalid Entry" message:@"Username and Password must both be at least 4 characters long." delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
  
      [alert show];
  
  } else if ([email length] &lt; 8) {
  
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Invalid Entry" message:@"Please enter your email address." delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
  
      [alert show];
  
  } else {
  </code></pre>
  
  <p>I would just like to add another <code>else if</code> into the above code and have it show an alert view if there are any characters that are NOT letters or numbers.</p>
  
  <p>Thanks.</p>