NSProtocolChecker

NSProtocolChecker Mac OS X 10.0

This class is used to provide a proxy for an object (the protocol checker's delegate) that filters messages sent to the object based on a formal protocol. Cocoa's distributed objects system uses this class to improve the performance of a distributed objects connection by limiting the messages sent an object to those agreed upon in a protocol. Instances of NSProtocolChecker are initialized with the method initWithTarget:protocol:. Target: is the object the protocol check will act as a proxy for, while protocol: is the protocol that defines what methods will be forwarded to the target object by the protocol checker. Note that the argument type for protocol: is a protocol object: Protocol *. To obtain a pointer to a protocol, use the @protocol(protocolName) compiler directive.

figs/cocn_1383.gif

@interface NSProtocolChecker : NSProxy
 // Initializers
   - (id)initWithTarget:(NSObject *)anObject protocol:(Protocol *)aProtocol;
 // Class Methods
   + (id)protocolCheckerWithTarget:(NSObject *)anObject protocol:(Protocol *)aProtocol;
 // Instance Methods
   - (Protocol *)protocol;
   - (NSObject *)target;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes