If I query a class with fields / columns that are Pointers to other tables (storing the string of the linked objectId), I get the following error message:
Error Domain=Parse Code=102 “-[PFObject length]: unrecognized selector sent to instance 0x6000037cb8a0” UserInfo={error=-[PFObject length]: unrecognized selector sent to instance 0x6000037cb8a0, NSLocalizedDescription=-[PFObject length]: unrecognized selector sent to instance 0x6000037cb8a0, code=102}
I am using iOS SDK, but I dont believe its a platform-specific issue / error.
I have included these columns as query.includeKeys()
, following research found from web searches, which suggests problems with Relations / Pointers with Local Datastore, but the problem remains.
To produce the error, I run the code below:
-
Comment the
query.fromLocalDatastore()
call in the code -
Run the query which populates the Local Datastore
-
Stop the app
-
Remove the comment from the code in step 1, so it now uses the Local Datastore, and comment the
pinAll()
call instead. -
The error message occurs, and the query returned
objects
isnil
Sample code:
let query = PFQuery(className: "Entry")
query.whereKey("CompID", contains: "someObjectId")
query.includeKey("UserID")
query.includeKey("CompID")
query.fromLocalDatastore()
query.findObjectsInBackground { (objects, error) in
if let error = error {
print("Get Error: \(error)")
}
print("Returned: \(objects?.count)")
if let objects = objects {
PFObject.pinAll(inBackground: objects, withName: name) { (success, error) in
if success {
print("Pinned all objects")
}
if error != nil {
print("Pinning error: \(error)")
}
}
}
}
Any assistance please?