Asynchronous call of Selector - is this code OK?
Asynchronous call of Selector - is this code OK?
- Subject: Asynchronous call of Selector - is this code OK?
- From: Manfred Lippert <email@hidden>
- Date: Fri, 01 Feb 2002 20:05:19 +0100
Hi,
is the following code OK, or may it have some strange effects (e.g. stack
overflow) if "someCondition" will not be TRUE for a longer time?
- (void) delayedMethod() {
// will be "asynchronously" called when "someCondition" becomes TRUE
}
- (void) callDelayedMethodAtSomeCondition {
if (someCondition) {
[self delayedMethod];
} else {
[self performSelector:@selector(callDelayedMethodAtSomeCondition)
withObject:nil
afterDelay:0.01];
}
}
Regards,
Mani