My app (iOS & Swift) has been running this function for months without problems. All of a sudden today, anytime I try to create a new object on my server I keep getting this error:
*** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<UIImage 0x7f90f3076a50> valueForUndefinedKey:]: this class is not key value coding-compliant for the key CGImage.’
Here’s the code that throws the error:
let dataStore = backendless.data.of(Chat.ofClass())
dataStore.save(
storedChat,
response: { (result: AnyObject!) -> Void in
let obj = result as! Chat
print(“Chat has been saved: (obj.objectId)”)
self.publishMessageAsync(“new_message”,type: “new_chat_message”,chatId: (self.storedChat?.objectId)!)
},
error: { (fault: Fault!) -> Void in
print(“fServer reported an error: (fault)”)
})
Any ideas here? I noticed this is happening ANYWHERE in my app where a new object is being saved to the server, updating and deleting work fine, but creating a new object crashes the app every time.
Thoughts?