Start a new topic

Swift and redundant conformance


I'm new to iOS and Swift and I'm trying to query my Kinvey store.

I have followed the documentation :

class Event: NSObject, KCSPersistable {



but XCode tells me "Redundant conformance of 'Event' to 'KCPersistable'".

Am I wrong ?

Thank you

No idea ?


You should be able to do:

class Event: NSObject

In swift without any issues, omitting the KCSPersistable should run without issue.

Please let me know if you run into any issues.


Thanks, it's ok without KCSPersistable.

I have another issue while loading empty values :


var entityId: String? 
var zipCode:String?

override func hostToKinveyPropertyMapping() -> [NSObject : AnyObject]! {
 return [
 "entityId" : KCSEntityKeyId, //the required _id field
 "zipCode" : "zipCode"


If zipCode is empty on the backend, I have an error : 

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0xe52238'


The error is raised when the value in the DB is "null" (not empty). If the field is an integer, the error is also raised if the value is empty in the db.

I suppose that the mapping of null integers is not possible in the iOS version.

The issue has been already encountered on Android :

I'm looking for a similar workaround in swift.


Can you provide a more complete set of source code to reproduce via email?  We're working on this, but can't seem to make it fail in the way that you have here.


1 person likes this

I have sent by email a simple project which includes the issue

Thanks Fabreax, 

I will pass this off now for review.

Enjoy your afternoon

Thanks Damien !


NSNull is not the same as nil. The NSNull class defines a singleton object used to represent null values in
collection objects (which don’t allow nil values). Please check following and let me know if it helps you:



Thanks for the explaination. The error seems to occur in the Json to object mapping, but in the Kinvey SDK.


Could you tell me if someone has been able to reproduce the issue ?



We are still having difficulty recreating the issue at this time.  I have the iOS engineer in the Boston office for the week so I'm going to have him walk me through the project today or tomorrow if at all possible and see if he can explain what might be happening to you.


Thanks Damien !

Login or Signup to post a comment