URLForUbiquityContainerIdentifier alway return nil

2019-02-15 12:14发布

问题:

URLForUbiquityContainerIdentifier: always returns nil

NSURL *ubiquityURL = [fileManager URLForUbiquityContainerIdentifier:nil];
if (ubiquityURL == nil)
  1. app build by xcode 4.5
  2. app is enabled iCloud
  3. IOS is logged in into iCloud account

ubiquityURL is normal in debug, but ubiquityURL is always nil after distribution to app store.

回答1:

It sounds like your release configuration has the wrong entitlements. What is your com.apple.developer.ubiquity-container-identifiers values in your .entitlements plist?