title: Captive Network Usage
body: <p>I am doing research to find the best way to use the captive network for iOS. It appears that what this does, correct me if I am wrong, is allows the user to input different ssid's and passwords that can be used for automatic login when that network becomes available. If this is so, what would be the best way to accomplish the following, read ssid and password from a user and connect him to that wifi network or is that even possible.</p>
  
  <p>So far all I am doing is pulling out the currently connected network with this:</p>
  
  <pre><code>NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
  id info = nil;
  
  for (NSString *ifnam in ifs) {
  
      NSLog(@"ifnam = %@", ifnam);
  
      info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge_retained CFStringRef)ifnam);
  
      if (info &amp;&amp; [info count]) {
          break;
      }
  }
  
  NSLog (@"SSID: %@", [ info objectForKey"@"SSID" ]);
  </code></pre>