Informal Protocols
You might come across the notion of an informal protocol in your readings. This is really a category that lists a group of methods but does not implement them. Everyone (or just about everyone) inherits from the same root object, so informal categories are often defined for the root class. Sometimes informal protocols are also referred to as abstract protocols.
If you look at the header file <NSScriptWhoseTests.h>, you might find some method declarations that look like this:
@interface NSObject (NSComparisonMethods)- (BOOL)isEqualTo:(id)object;- (BOOL)isLessThanOrEqualTo:(id)object;- (BOOL)isLessThan:(id)object;- (BOOL)isGreaterThanOrEqualTo:(id)object;- (BOOL)isGreaterThan:(id)object;- (BOOL)isNotEqualTo:(id)object; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access