Hello,
I am trying to make a question and answer type app to mimic Quora.
I have created the entities and have the persistance connection working and verified. When I try to create a new question from user input, I get this error.
[<BloQuery2.Question 0x1072937a0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key ___class.
I have looked all thru the documentation and online, cannot find reference to ___class.
When the user clicks the button, the app crashes. However, online, the question gets created, but without text.
Here is my code.
On AddQuestionViewController
@IBAction func addQuestion(sender: UIButton) {
backendless.setThrowException(false)
var result : AnyObject?
var fault : Fault?
result = backendless.persistenceService.save(Question())
if (result is Question) {
let obj : AnyObject = backendless.persistenceService.findByObject(Question)
if (obj is Question) {
let obj1 = obj as! Question
print("\nQuestion (1): \(obj1.description)")
userQuestion.text = obj1.question
}
}
if (result is Fault) {
print("Something went wrong")
}
and the QuestionEntity.swift file
import UIKit
import Foundation
class Question: NSObject {
var question : String?
var userName : String?
var objectId: String?
var created : NSDate?
var owner:BackendlessUser?
}