title: Stumped that [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil] keeps returning nil
body: <p>I have written a simple test application (Mac/Cocoa) to connect to the Key-Value store in iCloud. I seem to be falling at the first fence.</p>
  
  <p>You can see the code for my simple app here and you'll see that I am not getting a URL back from "URLForUbiquityContainerIdentifier" call.</p>
  
  <pre><code>- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  {
      // Insert code here to initialize your application
      NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
      if (!ubiq)
          NSLog(@"No iCloud");
      else
          NSLog(@"Yes iCloud");
  }
  </code></pre>
  
  <p>Screenshot of the app running with output:</p>
  
  <p><img src="https://i.stack.imgur.com/ZUlP1.png" alt="enter image description here"></p>
  
  <p>In term of trying to see if I've everything setup correctly I looked at the setup of my App Id (Test app is called Radio) in the developer provisioning centre:</p>
  
  <p><img src="https://i.stack.imgur.com/LJx01.png" alt="enter image description here"></p>
  
  <p>So that seemed to be ok. Then I re-created my provisioning profile (called Radio Dev 2) and checked that it was using the correct App Id:</p>
  
  <p><img src="https://i.stack.imgur.com/k1SRY.png" alt="enter image description here"></p>
  
  <p>Ok, so that also seemed to be ok. I then checked that entitlements was switched on and Key-Value container was activated:</p>
  
  <p><img src="https://i.stack.imgur.com/BRSKu.png" alt="enter image description here"></p>
  
  <p>So they are activated. I then took a look at the file itself, just to see if anything jumped out:</p>
  
  <p><img src="https://i.stack.imgur.com/yiaGq.png" alt="enter image description here"></p>
  
  <p>So I couldn't see anything jumping out at me in the entitlements file. Lastly, I confirmed that I was signing the build with the correct cert using the provisioning profile that I expected:</p>
  
  <p><img src="https://i.stack.imgur.com/WPSOk.png" alt="enter image description here"></p>
  
  <p>I was happy enough with that.</p>
  
  <p><strong>So I'm stumped.</strong> I've regenerated everything, etc, to no avail.</p>
  
  <p>I'd really appreciate if anybody has any ideas. Have I missed anything?</p>