I want to add an id to a pointer field in Parse. I have 2 classes categories and Ads. In the categories class, the objectId is a String that I am using to get all the fields of the Ads class. In the Ads class, the cat field is a pointer to categories. Now I add the cat id with another column that is a String. The String field is added but the pointer column 'cat' is not added.
Here is the code:
let ex = "s8HiwfvKtQ"
let posts = PFObject(className: "Ads")
posts.setObject(ex, forKey: "cat")
or alternatively
posts["cat"] = ex
posts.saveInBackground()
I tried the above code and found other solutions but still cannot save the cat field.
Below is a screenshot of the categories and Ads classes:

Error in console is:
invalid type for key cat, expected *categories, but got string (Code: 111, Version: 1.10.0)