Select to view content in your preferred language

State object for query task

2467
3
11-13-2011 08:39 AM
ShawnShepard
Occasional Contributor
Does anyone know if there is a state object that can be passed with a query task that can be used in the return method to identify which query task is returning?  It would seem that you would have to wait for one query to return before you can initiate another.
0 Kudos
3 Replies
RickJones
Deactivated User
You can call multiple queries without waiting.

The handler will be called as each finishes, possibly out of order.

ed: Apologies, I now understand what you were getting at. Without any way of tagging the query task, you are correct.
0 Kudos
NimeshJarecha
Esri Regular Contributor
All query task requests are asynchronous and you can send multiple requests without waiting for one to finish. Also, if you want to know which query's result returned in the delegate method then you should use NSOperation. Every query task request returns an NSOperation which you can compare with NSOperation returned in the result delegate method to determine which query's result is returned.

Hope this helps!

Regards,
Nimesh
0 Kudos
ShawnShepard
Occasional Contributor
Exactly what I was looking for.  Thank you
0 Kudos