Register custom class as user class (instead of BackendlessUser)

I want to get my custom class (child of BackendlessUser) in response after login (backendless.userService login:usernamepassword:password response:^(BackendlessUser *user)).
Is there any way to do this?

My custom class is (I attached sources of my custom class):
@interface UserBaaS : BackendlessUser
@property (strong, nonatomic) NSString *username;
@property (strong, nonatomic) NSString *phone;
@property (strong, nonatomic) NSNumber *yearFrom;
@property (strong, nonatomic) NSNumber *yearTo;
@property (strong, nonatomic) NSNumber *birthdayMonth;
@property (strong, nonatomic) NSNumber *birthdayDay;
@property (strong, nonatomic) NSNumber *sex;
@property (strong, nonatomic) NSString *avatar;
@end

Hi Pavel,

Since the signature for login is hardwired to return BackendlessUser, the only way I can think of is to handle the "upconversion from BackendlessUser to UserBaaS in the method’s callback and set it globally in the app.

Regards,
Mark

If I use in my UserBaaS init method: initWithBackendlessUser:(BackendlessUser *user) m, and then I use my own UserBaaS object (it will be not the object, that came from server, but it will be the object converted from the server object). And then I want to update the user object with new values for some fields, will it be possible? It will be the same as if I just created:

 BackendlessUser *user = [BackendlessUser new].
user.username = "myusername";
user.password = "mypassword"
user.customfield = "customfield";
backendless.userService update:user response:^(BackendlessUser *) {}

Will it work? or to edit the user I must use object from server or [backendless.userService currentUser] only?

With the latest update to SDK which we are working on, if you extend BackendlessUser, then you would be able to perform updates with a subclass. However register and login method would require you to re-initialize the global object.

If I need to update just one field of the User object (BackendlessUser), I need to fetch it from server at the beginning or I can use this code? :

BackendlessUser *user = [BackendlessUser new].
user.username = "myusername";
user.password = "mypassword"
user.customfield = "customfield";
backendless.userService update:user response:^(BackendlessUser *) {}

Actually I tested this code, and found that it doesn’t work, so the question is closed now. But I created another question (ralated to it), when I try to update BackendlessUser object (it was init with properties of current user) and app crashes. Pls take a look at http://support.backendless.com/responses/crashes-when-init-user-with-current-user-properties

P.S. If it’s not good to create different topics for related issues, pls just let me know. But I think it’s completely different, because there I even doesn’t create subclass and just use your methods.