//一个抽象的超类,为那些以替身的身份存在的对象或者还没存在的对象定义了一套API。 An abstract superclass defining an API for objects that act as stand-ins for other objects or for objects that don’t exist yet.
// 这里的意思大概是NSProxy的子类可以用来做消息的分发 Typically, a message to a proxy is forwarded to the real object or causes the proxy to load (or transform itself into) the real object. Subclasses of NSProxy can be used to implement transparent distributed messaging (for example, NSDistantObject) or for lazy instantiation of objects that are expensive to create.
//NSProxy实现了作为根类的一些基本的方法,包括在NSObject协议中定义的。然而,作为一个抽象类他没有提供一个实例化方法,在接收到任何他没有实现的方法时都会抛出异常。 NSProxy implements the basic methods required of a root class, including those defined in the NSObject protocol. However, as an abstract class it doesn’t provide an initialization method, and it raises an exception upon receiving any message it doesn’t respond to.
//因此 一个具体的子类必提供一个实例化方法或者创建方法。并且覆盖`forwardInvocation`方法和`methodSignatureForSelector`方法来处理类本身没有实现的方法。 A concrete subclass must therefore provide an initialization or creation method and override the forwardInvocation: and methodSignatureForSelector: methods to handle messages that it doesn’t implement itself.
//子类中`forwardInvocation`的实现中应该做任何需要的来处理invocation,比如通过网络转发这个invocation,或者加载一个的对象并将这个invocation转发给他。 A subclass’s implementation of forwardInvocation: should do whatever is needed to process the invocation, such as forwarding the invocation over the network or loading the real object and passing it the invocation.
//`methodSignatureForSelector`是用来获取给定消息的参数类型;在子类的实现中可以获取这个将要被转发的消息的参数类型。同时应该创建一个相对应的NSMethodSignature对象。 methodSignatureForSelector: is required to provide argument type information for a given message; a subclass’s implementation should be able to determine the argument types for the messages it needs to forward and should construct an NSMethodSignature object accordingly. See the NSDistantObject, NSInvocation, and NSMethodSignatureclass specifications for more information.