- Home /
For-loop and Firebase
Hello,
First, this is the code:
for (int j = 1; i <= count; j++)
{
db.Child("Some Child").GetValueAsync().ContinueWith(task =>
{
Debug.Log("j: " + j); // Here the Debug will show me that j = count
if (task.IsFaulted)
{
// ERROR HANDLER
}
else if (task.IsCompleted)
{
// Some Code Here
}
});
}
Ok, so my problem is that after the "....ContinueWith(task => ..." j will become directly equal to the count variable. Why this happen and how to solve it?
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to find the minimum number in a float array C# 1 Answer
Array Overflow Problem 1 Answer
C# Killfeed issues 0 Answers