[[self.view.window subviews] makeObjectsPerformSelector:@selector(setUserInteractionEnabled:) withObject:[NSNumber numberWithBool:NO]];
I saw this code in another question's answer ( How to disable touch input to all views except the top-most view?) and it surprised me when it worked, as setUserInteractionEnabled:
expects a BOOL (which as it's not an objective-c object can't be passed in performSelector:withObject:
type methods).
Where is the documentation that says that passing an NSNumber is ok? Does it work for all methods, or is a special implementation needed? And does it only work with BOOLs, or can it be done with types like int
?