Consider this code:
[self otherStuff];
// "wait here..." until something finishes
while(!self.someFlag){}
[self moreStuff];
Please note that this all happens ONE THREAD - we do not want to go to another thread.
otherStuff can do things like connect to the cloud, get user input, etc., so it will take a lot of time and can follow many possible paths.
otherStuff sets self.someFlag to true when elseStuff completes.
This works fine, and no problem with it at all - except that it is limping to burn the processor with an empty loop !!
Pretty simple, is there a way to say something like ..
halt here, until (some message, interrupt, flag, boolean, whatever?)
Instead of just (! Self.someFlag) {}
( , "" ... "otherStuff" " ", "moreStuff", , otherStuff .. , , .) Cheers!!
, , .