public User Login(User user)
{
User responseUser = null; ;
parse.Users.Login<User>("hello", "99999", r =>
{
if (r.Success) { responseUser = r.Data; }
});
return responseUser;
}
Why return responseUser is null but r.Data is not null? Thank you!!!
You haven’t told us how the
parse.Users.Login<User>function works but it seems that it is asynchronous. This means that it will return immediately and the callback called much later. So you will return null from the main function.You need to modify the Login function so that it works with a callback as well: