title: CWNetwork get WiFi security mode
body: <p>I am trying to get security mode with the following code:</p>
  
  <pre><code>main()
  {
      CWNetwork *network = [self.scanResults objectAtIndex:row];
      NSLog(@"%@", network);
      NSLog(@"%@", [self securityStringForNetwork:network]);
   }
  
  - (NSString*)securityStringForNetwork:(CWNetwork *)network;
  {
      NSString *securityString = @"Unknown";
  
      if ([network supportsSecurity:kCWSecurityNone])
          securityString = @"None";
      else if ([network supportsSecurity:kCWSecurityWEP])
          securityString = @"WEP";
      else if ([network supportsSecurity:kCWSecurityWPAPersonal])
          securityString = @"WPA Personal";
      else if ([network supportsSecurity:kCWSecurityWPAPersonalMixed])
          securityString = @"WPA Personal Mixed";
      else if ([network supportsSecurity:kCWSecurityWPA2Personal])
          securityString = @"WPA2 Personal";
      else if ([network supportsSecurity:kCWSecurityPersonal])
          securityString = @"Personal";
      else if ([network supportsSecurity:kCWSecurityDynamicWEP])
          securityString = @"Dynamic WEP";
      else if ([network supportsSecurity:kCWSecurityWPAEnterprise])
          securityString = @"WPA Enterprise";
      else if ([network supportsSecurity:kCWSecurityWPAEnterpriseMixed])
          securityString = @"WPA Enterprise Mixed";
      else if ([network supportsSecurity:kCWSecurityWPA2Enterprise])
          securityString = @"WPA2 Enterprise";
      else if ([network supportsSecurity:kCWSecurityEnterprise])
          securityString = @"Enterprise";
  
      return securityString;
  }
  </code></pre>
  
  <p>The first NSLog displays: </p>
  
  <p><strong>WPA2 Personal</strong></p>
  
  <p>and the second NSLog displays:</p>
  
  <p><strong>WPA Personal Mixed</strong></p>
  
  <p>I realize that supportsSecurity method may return YES on few types of security. </p>
  
  <p>How can I get the exact security mode for the network?</p>