I'm reading the source code of an open-source project and I've encountered the following category definition in an implementation file:
@interface QCView (Private)
- (void)_pause;
- (void)setClearsBackground:(BOOL)flag;
@end
At first I thought that the setClearsBackground
method was being added to the QCView
class definition. But when I search through this implementation file, I find no implementation of a setClearsBackground
method (although this message is sent to a QCView
instance in a few places within the file).
Why would someone declare a method on a framework class like QCView
but then not implement that method anywhere? My only guess is that this is a way to circumvent the compiler and call a method that isn't declared in the QCView.h
file. But this seems unlikely, because how would the developer know that an implementation for this method even exists?