Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alexbleks

macrumors newbie
Original poster
Apr 22, 2009
6
0
Hi

Code:
- (IBAction) Call1 
{
  
  for (int i=0; i < 6; i++)
  {
      printf("Processing ID %d", i);
      [self Call2];
  }

  printf("User check is completed!");
}

- (IBAction) Call2
{
    // Get some user inputs from UI
    

}

How can I make "User check is completed!" print after the WHOLE "for" loop has been checked with all the other functions in Call2 before it says "User check completed"?.. Now it rushes through it without waiting for all data to be completed.
 
Unless Call2 (by the way the convention is to start method names with a lower case letter so that should be call2) is in some way asynchronous then it will work as you want.

Here's a tip for getting help: post the real, unedited code. What you have above is pointless.
 
How can I make "User check is completed!" print after the WHOLE "for" loop has been checked with all the other functions in Call2 before it says "User check completed"?.. Now it rushes through it without waiting for all data to be completed.

Break your code up into more methods.

Put your "User check is completed!" print statement in another method, and call that method from the completion routine of the last data collection method.
 
I think, before we suggest anything, we really need to see exactly what happens within Call2, as robbieduncan has already asked for.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.