I have a button that triggers a method. When the method is executed I have a second window pop up that asks for the level of the creature and if he was killed or still alive to do some math. When the second window opens I want the code in the method to pause or wait until the new information is entered so it can do the math correctly adding bonuses and what not.
I thought this might work but I get a beach ball of death.
With the close button on the second window making the doaWindowOpen = NO; which should exit the loop and continue the code.
Is there some code I am unaware of that will hold the rest of the method from executing until I close the second window?
I thought this might work but I get a beach ball of death.
Code:
- (IBAction)endCombatButton:(id)sender {
doaWindowOpen = YES;
[doaWindow makeKeyAndOrderFront:self];
while (doaWindowOpen) {
;
}
Code:
- (IBAction)doaWindowCloseButton:(id)sender {
doaWindowOpen = NO;
[doaWindow orderOut:self];
}
Is there some code I am unaware of that will hold the rest of the method from executing until I close the second window?