title: iOS6.1: Problems while trying to access WiFi RSSI (MobileWiFi.framework)
body: <p>I'm trying to access the RSSI values of several APs around me using an iPod Touch 4G with iOS6.1 and Xcode 4.6.3 with a valid Provisioning Profile. I've read some discussions about this topic and the best way to do this seems to be using the private Framework MobileWifi. Since this project is for private usage only I'm ok with that.</p>
  
  <p>According to <a href="http://www.iphonedevwiki.net/index.php/MobileWiFi.framework" rel="nofollow">this</a> website I need a special entitlement in order to access the MobileWiFi functions. I've never worked with entitlements before, but according to some examples my .entitlement file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;keychain-access-groups&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;$(AppIdentifierPrefix)com.apple.wifi.manager-access&lt;/string&gt;
      &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>I also did a jailbreak and installed AppSync in order to get rid of errors according to invalid entitlements. I am able to run the app on my iPod, but every time i want to check for networks or devices the app crashes. Here is my code so far:</p>
  
  <pre><code>WiFiManagerRef manager = WiFiManagerClientCreate(kCFAllocatorDefault, 0);
  if (!manager)
      NSLog(@"ERROR: Couldn't create WiFiManagerClient!");
  
  CFArrayRef devices = WiFiManagerClientCopyDevices(manager);
  if (!devices)
      NSLog(@"ERROR: devices is NULL");
  
  CFArrayRef networks = WiFiManagerClientCopyNetworks(manager);
  if (!networks)
      NSLog(@"ERROR: networks is NULL");
  
  NSLog(@"manager: %@", manager);
  NSLog(@"%d devices: %@", (int)CFArrayGetCount(devices), devices);
  NSLog(@"%d networks: %@",(int)CFArrayGetCount(networks), networks);
  </code></pre>
  
  <p>It seems that the <code>WiFiManagerClientCopyDevices</code> and <code>WiFiManagerClientCopyNetworks</code> methods return some bad values, if I set some checkpoint to check their addresses they're 0x00000000 after calling these methods and the app crashes due to EXC_BAD_ACCESS when returning their array count.</p>
  
  <p>I've read that the MobileWifi functions won't work if I won't use the correct entitlements. Some others wrote that instead of a .entitlement file one should use a entitlement.xml file and use <code>ldid</code>to code sign the app and transfer it onto the device, but I don't like to do this manually since I prefer using Xcode's debugger and console while coding.</p>
  
  <p>I spent a whole day trying to get rid of these problems but I didn't find any solutions, so I would be really glad if someone could help me out with this!</p>