I am calling a method from two threads and thought I try this:
- (void)hideEnterButton
{
if ([NSThread isMainThread])
{
enterButton.hidden = YES;
}
else
{
[self performSelectorOnMainThread:@selector(hideEnterButton) withObject:nil waitUntilDone:NO];
}
}
Reason for this is that I understand that all GUI handling must be done on the main thread.
Will this work?
The proper term is recursive, not circular and yes, it’s perfectly fine to do this.