containerURLForSecurityApplicationGroupIdentifier returns nil on iOS Simulator

前端 未结 7 1381
我寻月下人不归
我寻月下人不归 2020-12-18 18:27

Context

With iOS8 and extensions Apple introduced the App group containers (more info here).

Problem

We use it through NSFileManager\'s

7条回答
  •  太阳男子
    2020-12-18 19:07

    I was able to solve this problem on my side. The documentation says

    Your app must have a com.apple.security.application-groups entitlement for the specified application group. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/index.html#//apple_ref/occ/instm/NSFileManager/containerURLForSecurityApplicationGroupIdentifier:

    At some point in my app, I had removed the entitlements file from my app target/build settings/code signing/code signing entitlements . Both debug and release must include YOUR_APP.entitlements file . My debug wasn't including it so it wasn't working on simulator

提交回复
热议问题