var jsonData = Model.CheckData();
// If i get the response for then, i must pass the response to the following functions which are below.
if (!jsonData) {
Ti.API.warn("JsonData");
SendRes(jsonData);
}
The problem i am facing is, the functions are getting executed before i get the response at the first place. It should happen sequentially.
Note: I cannot call the function SendRes on my Json OnLoad, as its in a different class all together.
I assume
Model.CheckData()is an AJAX call. You can give it a callback once ajax is done. You will have to modify that call to accept a callback: