0

I am using FEMMapping for mapping .I am getting this error :: [<__NSCFString 0x600003802460> valueForUndefinedKey:]: this class is not key value coding-compliant for the key XYZ

 class func defaultmapping()->FEMMapping{
  mapping.addAttribute(Mapping.intAttributeFor(property: "XYZ", keyPath: "XYZ"))
}
 let objVisit = deserialiser.object(fromRepresentation: dicVisit, mapping: mapping)
print(objVisit)

getting error at line let objVisit = ...

  • Does this answer your question? [Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?](https://stackoverflow.com/questions/3088059/xcode-how-to-fix-nsunknownkeyexception-reason-this-class-is-not-key-valu) – SPatel Mar 20 '20 at 08:10
  • No. I have problem in mapping .Its not coming while set any value – krishna solanki Mar 20 '20 at 08:45
  • The error says you tried to set the property `XYZ` on an instance of `NSString`, so you haven't done something right... – Paulw11 Mar 20 '20 at 09:02
  • but what may be issue it may happen that value is of different type and trying to set as integer ? – krishna solanki Mar 20 '20 at 09:20
  • I have map other attribute in same way and its working – krishna solanki Mar 20 '20 at 10:22

0 Answers0