Start a new topic
Answered

undeclared type 'map' in custom user

hi, i strongly feel it is a syntax problem for swift. I have followed all the steps in the doc. not sure what wrong i am doing. any help would be appreciated


image



Best Answer
Pratap,

What is the version of the SDK that you are using?

I am able to create custom user in my environment using following code. Make sure you have included object mapper which is used for mapping of the attributes using 'import ObjectMapper':

 

import UIKit
import Kinvey
import ObjectMapper

class CustomUser: User {

    var address: String?
    var first_name: String?
    var last_name: String?
    
    override func mapping(map: Map) {
        super.mapping(map: map)
        address <- map["address"]
        first_name <- map["first_name"]
        last_name <- map["last_name"]
    }
    
}

 


 If above information doesn't help, then please take a look at our iOS sample app http://devcenter.kinvey.com/ios/samples/ios-starter#.


Thanks,

Pranav

Kinvey

 


Pratap,

Glad it is working for you!

Also we have released new iOS SDK version 3.3.8. Please upgrade your SDK at the following link http://devcenter.kinvey.com/ios/downloads#.

 

Thanks,

Pranav

Kinvey


1 person likes this

Pranav, including 'object mapper' solved the issue. thank you again for all your help !

Pranav, sorry for late reply. i am using version 3.3.6. I haven't tried your code yet as I am travelling. I will try it asap and reply.

Answer
Pratap,

What is the version of the SDK that you are using?

I am able to create custom user in my environment using following code. Make sure you have included object mapper which is used for mapping of the attributes using 'import ObjectMapper':

 

import UIKit
import Kinvey
import ObjectMapper

class CustomUser: User {

    var address: String?
    var first_name: String?
    var last_name: String?
    
    override func mapping(map: Map) {
        super.mapping(map: map)
        address <- map["address"]
        first_name <- map["first_name"]
        last_name <- map["last_name"]
    }
    
}

 


 If above information doesn't help, then please take a look at our iOS sample app http://devcenter.kinvey.com/ios/samples/ios-starter#.


Thanks,

Pranav

Kinvey

 

Pratap,

I have started looking into it. Will get back to you asap.

Thanks,
Pranav
Kinvey

 

Login or Signup to post a comment