wait until a methd has finished?

whitesaint

cocoa love
Is there a way to wait until a certain method is finished, to perform another method? All feedback is welcome and appreciated, thanks.

-whitesaint
 
im sorry i think you misunderstood me.

The method is being invoked just like any method-

[myObject performThisMethod:withArgument];

I did not mean automatic symmetric multithreading (lol):p, I meant is there a way for this method to finish it's data processing and stuff before the current object invokes another method....??

Thanks for the reply
 
If I'm understanding you right, the answer is ALWAYS yes. If that wasn't the way things worked, it would be incredibly hard to write code, as you would have to take into account the amount of a time for a method to run.

Look at this code:
Code:
int i = 0;
i = [self foo:i];
i = [self foo:i];

If foo didn't return before we move onto the second call to foo, we'd get an unexpected answer. Running code is like reading a book - you read it in order, one word at a time. You shouldn't skip ahead and miss words because that can change the meaning of statements.

Or am I missing what you're getting at?

F-bacher
 
Back
Top