On a button click, I am calling a web service and after that I am pushing a UIViewController. My UIViewController should load with the data obtained from the web service. But currently, before my web service is called, the UIViewController is being pushed. What can I do to make sure that my UIViewController is not loaded before all the web service calls are made and data retrieved.
Here is the code I am using.
MyWebService *webservice = [MyWebService myWebService];
webservice.delegate = self;
[webservice getMyDataWithMyNumber:mySharedNumber myOldNumber:temp];
[webservice getvDetailsWithmyData:myData myNumber:myNumber];
MyViewController *myViewController = [[MyViewController alloc]initWithNibName:@"MyViewController" bundle:nil];
[self.navigationController pushViewController: myViewController animated:YES];
[myViewController release];
Edit: The UIViewController should be pushed only after both web services are called.
I am passing an array to the new UIViewController. The array objects are added during the web service call. I cant figure out a way to do this. Need help. Thanks.