Up

NSProxy class reference

Authors

Richard Frith-Macdonald (richard@brainstorm.co.uk)

Version: 1.31

Date: 2004/09/20 10:10:10

Copyright: (C) 1997 Free Software Foundation, Inc.

Software documentation for the NSProxy class

NSProxy

Declared in:
Foundation/NSProxy.h
Conforms to:
NSObject
Standards:

The NSProxy class provides a basic implementation of a class whose instances are used to stand in for other objects.
The class provides the most basic methods of NSObject, and expects messages for other methods to be forwarded to the real object represented by the proxy. You must subclass NSProxy to implement -forwardInvocation: to these real objects.

Note that NSProxy is a different sort of class than others in the GNUstep Base library in that it is the only example of a root class besides NSObject . Thus, it defines its own isa variable and implements the NSObject protocol.


Instance Variables

Method summary

alloc 

+ (id) alloc;

Allocates and returns an NSProxy instance in the default zone.


allocWithZone: 

+ (id) allocWithZone: (NSZone*)z;

Allocates and returns an NSProxy instance in the specified zone z.


autorelease 

+ (id) autorelease;

Returns the receiver.


class 

+ (Class) class;

Returns the receiver.


description 

+ (NSString*) description;

Returns a string describing the receiver.


isKindOfClass: 

+ (BOOL) isKindOfClass: (Class)aClass;

Returns NO... the NSProxy class cannot be an instance of any class.


isMemberOfClass: 

+ (BOOL) isMemberOfClass: (Class)aClass;

Returns YES if aClass is identical to the receiver, NO otherwise.


load 

+ (void) load;

A dummy method...


release 

+ (void) release;

A dummy method to ensure that the class can safely be held in containers.


respondsToSelector: 

+ (BOOL) respondsToSelector: (SEL)aSelector;

Returns YES if the receiver responds to aSelector, NO otherwise.


retain 

+ (id) retain;

Returns the receiver.


retainCount 

+ (unsigned int) retainCount;

Returns the maximum unsigned integer value.


autorelease 

- (id) autorelease;

Adds the receiver to the current autorelease pool and returns self.


class 

- (Class) class;

Returns the class of the receiver.


conformsToProtocol: 

- (BOOL) conformsToProtocol: (Protocol*)aProtocol;

Calls the -forwardInvocation: method to determine if the 'real' object referred to by the proxy conforms to aProtocol. Returns the result.
NB. The default operation of -forwardInvocation: is to raise an exception.


dealloc 

- (void) dealloc;

Frees the memory used by the receiver.


description 

- (NSString*) description;

Returns a text descrioption of the receiver.


forwardInvocation: 

- (void) forwardInvocation: (NSInvocation*)anInvocation;
Subclasses should override this method.

Raises an NSInvalidArgumentException.


hash 

- (unsigned int) hash;

Returns the address of the receiver... so it can be stored in a dictionary.


init 

- (id) init;
This is a designated initialiser for the class.
Subclasses should override this method.

Initialises the receiver and returns the resulting instance.


isEqual: 

- (BOOL) isEqual: (id)anObject;

Tests for pointer equality with anObject.


isKindOfClass: 

- (BOOL) isKindOfClass: (Class)aClass;

Calls the -forwardInvocation: method to determine if the 'real' object referred to by the proxy is an instance of the specified class. Returns the result.
NB. The default operation of -forwardInvocation: is to raise an exception.


isMemberOfClass: 

- (BOOL) isMemberOfClass: (Class)aClass;

Calls the -forwardInvocation: method to determine if the 'real' object referred to by the proxy is an instance of the specified class. Returns the result.
NB. The default operation of -forwardInvocation: is to raise an exception.


isProxy 

- (BOOL) isProxy;

Returns YES.


methodSignatureForSelector: 

- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;

If we respond to the method directly, create and return a method signature. Otherwise raise an exception.


release 

- (void) release;

Decrement the retain count for the receiver... deallocate if it would become negative.


respondsToSelector: 

- (BOOL) respondsToSelector: (SEL)aSelector;

If we respond to the method directly, return YES, otherwise forward this request to the object we are acting as a proxy for.


retain 

- (id) retain;

Increment the retain count for the receiver.


retainCount 

- (unsigned int) retainCount;

Return the retain count for the receiver.


self 

- (id) self;

Returns the receiver.


superclass 

- (Class) superclass;

Returns the superclass of the receiver's class.


zone 

- (NSZone*) zone;

Returns the zone in which the receiver was allocated.




Instance Variables for NSProxy Class

isa

@public Class isa;

Description forthcoming.






Up