Start a new topic

Setting _acl when saving a new object

I'm trying to save a new object with .setGloballyWritable/setGloballyReadable true. I did the below code before saving that was similar to some of the examples: 

collection.metadata = KCSMetadata()



However, when I try to save the object, I get 

'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: _kmd)'

Is there a way to set _acl without creating the object first and backtracking?

1 Comment

Hi Stephanie,

Please take a look at the following link for setting Entity level permissions and the corresponding code snippets as well:

Also, provide me with following information:

  • KinveyKit version you are using
  • Code of the class that represents your entity (where you have the metadata member variable and the hostToKinveyPropertyMapping() function)
  • Code for the entity object creation and saving the entity object.

Kinvey Support

Login or Signup to post a comment