Problem saving another user's property

Something strange is happening to me.

I have a reference to another user (userA) who I can follow. When I hit the follow button, it adds +1 to that user’s property of type int. And all works good. So now userA.property = 1.

When I repeat the same steps for another User (userB), userB’s property becomes 1 but userA’s property becomes 0, without any reference to userA (I’m in the profile’s view of the user so I have a unique reference to each user).
So now I have
userA.property = 0
userB.property = 1
instead

userA.property = 1
userB.property = 1

This is the code that I’m using to update another user’s property…
NSDictionary *property = [NSDictionary dictionaryWithObject:followersPeopleNumber forKey:kUserFollowersPeopleNumber];

[user updateProperties:property];
[[backendless.persistenceService of:[BackendlessUser class]] save:user];

Hi Francesco,

Try going through the code with debugger and monitor the value of userA.property, you should be able to see at what point it changes back to 0.

Regards,
Mark

I will try but the problem is that in my code I update only one user at same time, but it changes more users

I am interested in find out at what point it changes. It should give you and us some clues.

Found it! It was my mistake.
It’s not very simple to explain my error but, in a few words, I was saving an user not updated yet.
I’m saving in the same time myself (user logged in) with an updated relation with users that I’m following and the followed user with a +1 added to his property. My error was that I was updating myself first then the other user and the value was 0.
Thanks and sorry for this “no real problem”

No worries! I am glad you got is resolved.