private bool IsExitPhoneNumber(string phone)
{
bool isExit = false;
AVQuery<AVObject> query = new AVQuery<AVObject>("UserInfo");
query = query.WhereEqualTo("phone", phone);
query.FindAsync().ContinueWith(t =>
{
if (t.IsCanceled)
{
//保存因为某些原因取消了
}
else if (t.IsFaulted)
{
//有异常,获取出来以便处理
AggregateException exception = t.Exception;
}
else
{
//成功了
var user = t.Result;
IEnumerator<AVObject> enumerator = user.GetEnumerator();
Debug.Log(enumerator.ToString());
if (enumerator.MoveNext())
{
var usertemp = enumerator.Current;
Debug.Log(usertemp.ToString());
Debug.Log(usertemp.Get<string>("password"));
isExit = true;
}
}
});
return isExit;
}
调用这个函数的时候,query.FindAsync().不会马上执行,所以我每次判断都会返回false,请问这个如何解决啊,急求!!
-
创建时间
18年6月1日
-
最后回复
20年1月10日
-
1
回复
-
1.1K
浏览
-
2
用户