0
votes

I've a class called category, and I have retrieved my categories from local datastore through query.getFromLocalDataStore().

Next I've the following code

var userExpense = PFObject(className: "Expenses")
userExpense["category"] = category 
userExpense.saveEventually()
userExpense.pin()

And now i'm getting this error,

{error={"__type":"Pointer","className":"Category","localId":"local_55876b12913120b9"} is not a valid Pointer, code=106}

Any idea why? I wanted

1

1 Answers

0
votes

If I'm correct, you downloaded the category variable as a PFObject, not as a pointer. What you can do, is to create a pointer from your category with the method:

objectWithoutDataWithClassName:objectId:

and set that to userExpense["category"], and that will be a valid pointer.