Parse.com invalid type for key, expected string but received array

I am trying to save my data on parse.com. I have already prepared a class on parse.com called "SomeClass". This is a column named "mySpecialColumn" with the String data type.

This is the code I'm trying to save with:

var groupObject = PFObject(className: "SomeClass") groupObject.addObject("aaa", forKey: "mySpecialColumn") groupObject.saveEventually() 

If I run this, I get:

Error: invalid type for key mySpecialColumn, expected row, but received array (Code: 111, Version: 1.6.0)

Here's what my kernel looks like on parse.com:

This is how my core at parse.com look like

Does anyone know why I am getting this error? I also tried to do this in a lazy way, rather than pre-creating a data class and just creating it on the fly, but then it creates all the columns as an Array data type.

+7
ios swift pfobject
source share
1 answer

The addObject method addObject used to add a new object to the array corresponding to this key. Saving fails because you are trying to save the array in which the row is expected.

Instead, you should use setObject:forKey:

+11
source share

All Articles