title: IPhone simple phone number validation
body: <p>I find all kinds of phone number validations on stackoverflow for the iphone but none seem to validate they just seem to change the format. example <a href="https://stackoverflow.com/questions/6052966/phone-number-formatting">Phone number formatting</a>. </p>
  
  <p>Goals: this number is being entered via an alert. North American with or with out dashes. </p>
  
  <p>so have some code but every thing is coming up as invalid any ideas.</p>
  
  <pre><code>- (void)textFieldDidEndEditing:(UITextField *)textField {
  
  NSString *str=@"^\\+(?:[0-9] ?){6,14}[0-9]$";
  NSPredicate *no=[NSPredicate predicateWithFormat:@"SELF MATCHES %@",str];
  if([no evaluateWithObject:textField.text]==NO)
     { 
  
         UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Warning" message:@"Please Enter correct contact no." delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
  
         [alert show];
         [alert release];
  
     }
     else{
  NSString *textValue = textField.text;
  NSLog(@"Value: %@", textValue);
     }
  }
  </code></pre>