vendredi 8 mai 2015

Get the current user custom column data in Swift Parse

As you can see the picture, this is the User class that allow user to login in my ios application

As I login via this user to my own application, after I've login, how do I get the custom column data of this user? For example, I want to get the IntakeCode from this user and show it in text field, how to I do that?

I've try this code, but it doesn't work, it says that

'AnyObject' is not convertible to 'String'; did you mean to use 'as!' to force downcast?

var displayIntake:NSString = PFUser.currentUser()!.objectForKey("IntakeCode")
txtIntake.text = displayIntake as String

Hope that someone can help with it, I just want that IntakeCode from this user show in the textfield.

Aucun commentaire:

Enregistrer un commentaire