Up
Authors
- Andrew Kachites McCallum (
mccallum@gnu.ai.mit.edu
)
-
Version: 27630
Date: 2009-01-19 11:00:33 +0000 (Mon, 19 Jan 2009)
Copyright: (C) 1995, 1996, 1998 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSObject.h
- Conforms to:
- NSObject
Availability: OpenStep
NSObject
is the root class (a root
class is a class with no superclass) of the GNUstep
base library class hierarchy, so all classes normally
inherit from NSObject
. There is an
exception though: NSProxy
(which is
used for remote messaging) does not inherit from
NSObject
.
Unless you are really sure of what you are doing,
all your own classes should inherit (directly or
indirectly) from NSObject
(or in
special cases from NSProxy
).
NSObject
provides the basic common
functionality shared by all GNUstep classes
and objects.
The essential methods which must be implemented by all
classes for their instances to be usable within
GNUstep are declared in a separate protocol, which
is the NSObject
protocol. Both
NSObject
and NSProxy
conform to this protocol, which means all objects
in a GNUstep application will conform to this protocol
(btw, if you don't find a method of
NSObject
you are looking for in this
documentation, make sure you also look into
the documentation for the NSObject
protocol).
Theoretically, in special cases you might
need to implement a new root class. If you do, you
need to make sure that your root class conforms (at
least) to the NSObject
protocol,
otherwise it will not interact correctly with the
GNUstep framework. Said that, I must note that I
have never seen a case in which a new root class is
needed.
NSObject
is a root class, which implies
that instance methods of NSObject
are
treated in a special way by the Objective-C
runtime. This is an exception to the normal way
messaging works with class and instance methods:
if the Objective-C runtime can't find a class method for
a class object, as a last resort it looks for an instance
method of the root class with the same name, and
executes it if it finds it. This means that
instance methods of the root class (such as
NSObject
) can be performed by class
objects which inherit from that root class ! This
can only happen if the class doesn't have a class
method with the same name, otherwise that method -
of course - takes the precedence. Because of this
exception, NSObject
's instance
methods are written in such a way that they work
both on NSObject
's instances and on
class objects.
Instance Variables
Method summary
+ (id)
alloc;
Availability: OpenStep
+ (id)
allocWithZone: (
NSZone*)z;
Availability: OpenStep
This is the basic method to create a new instance. It
allocates a new instance of the receiver from the
specified memory zone.
Memory for an instance of the receiver is
allocated; a pointer to this newly created
instance is returned. All instance variables are
set to 0 except the isa
pointer which is
set to point to the object class. No initialization
of the instance is performed: it is your
responsibility to initialize the instance
by calling an appropriate init
method. If
you are not using the garbage collector, it is also
your responsibility to make sure the returned
instance is destroyed when you finish using it,
by calling the release
method to destroy
the instance directly, or by using
autorelease
and autorelease pools.
You do not normally need to override this method in
subclasses, unless you are implementing a
class which for some reasons silently allocates
instances of another class (this is typically
needed to implement class clusters and similar
design schemes).
If you have turned on debugging of object allocation
(by calling the GSDebugAllocationActive
function), this method will also update the
various debugging counts and monitors of
allocated objects, which you can access using
the GSDebugAllocation...
functions.
+ (Class)
class;
Availability: OpenStep
Returns the receiver.
+ (
NSString*)
description;
Availability: OpenStep
Returns a string describing the receiving class.
The default implementation gives the name of the class
by calling
NSStringFromClass()
.
+ (void)
initialize;
Availability: OpenStep
This message is sent to a class once just before it is
used for the first time. If class has a superclass,
its implementation of
+initialize
is called first. You can implement
+initialize
in your own class if you need to. NSObject's
implementation handles essential root object
and base library initialization.
+ (IMP)
instanceMethodForSelector: (SEL)aSelector;
Availability: OpenStep
Returns a pointer to the C function implementing
the method used to respond to messages with
aSelector by instances of the receiving
class.
Raises NSInvalidArgumentException if
given a null selector.
+ (
NSMethodSignature*)
instanceMethodSignatureForSelector: (SEL)aSelector;
Availability: OpenStep
Returns a pointer to the C function implementing
the method used to respond to messages with
aSelector which are sent to instances of
the receiving class.
Raises
NSInvalidArgumentException if
given a null selector.
+ (BOOL)
instancesRespondToSelector: (SEL)aSelector;
Availability: OpenStep
Returns a flag to say if instances of the receiver
class will respond to the specified selector. This
ignores situations where a subclass implements
-forwardInvocation:
to respond to selectors not normally handled... in these
cases the subclass may override this method to handle
it.
If given a null selector, raises
NSInvalidArgumentException when
in MacOS-X compatibility more, or returns
NO
otherwise.
+ (BOOL)
isSubclassOfClass: (Class)aClass;
Availability: OpenStep
Returns YES
if the receiver is
aClass or a subclass of aClass.
+ (id)
new;
Availability: OpenStep
This method is a short-hand for alloc followed by
init, that is,
NSObject *object = [NSObject new];
is exactly the same as
NSObject *object = [[NSObject alloc] init];
This is a general convention: all
new...
methods are supposed to return
a newly allocated and initialized instance, as would be
generated by an alloc
method
followed by a corresponding init...
method. Please note that if you are not using a
garbage collector, this means that instances
generated by the new...
methods
are not autoreleased, that is, you are responsible
for releasing (autoreleasing) the instances yourself.
So when you use new
you typically do
something like:
NSMutableArray *array = AUTORELEASE
([NSMutableArray new]);
You do not normally need to override new
in subclasses, because if you override
init
(and optionally
allocWithZone:
if you really need),
new
will automatically use your
subclass methods.
You might need instead to define new
new...
methods specific to your
subclass to match any init...
specific to your subclass. For example, if your
subclass defines an instance method
initWithName:
it might be handy for you to have a class method
newWithName:
which combines alloc
and
initWithName:
. You would implement it
as follows:
+ (id) newWithName: (NSString
*)aName {return [[self alloc] initWithName:
aName];}
+ (void)
poseAsClass: (Class)aClassObject;
Availability: OpenStep
Sets up the ObjC runtime so that the receiver is used
wherever code calls for aClassObject to
be used.
+ (id)
setVersion: (int)aVersion;
Availability: OpenStep
Sets the version number of the receiving class. Should
be nonnegative.
+ (Class)
superclass;
Availability: OpenStep
Returns the super class from which the receiver was
derived.
+ (int)
version;
Availability: OpenStep
Returns the version number of the receiving class.
This will default to a number assigned by the
Objective C compiler if [NSObject -setVersion]
has not been called.
- (id)
autorelease;
Availability: OpenStep
Adds the receiver to the current autorelease pool, so
that it will be sent a
-release
message when the pool is destroyed.
Returns
the receiver.
In GNUstep, the
[NSObject +enableDoubleReleaseCheck:]
method may be used to turn on checking for retain/release errors in this method.
- (id)
awakeAfterUsingCoder: (
NSCoder*)aDecoder;
Availability: OpenStep
Called after the receiver has been created by
decoding some sort of archive. Returns self.
Subclasses may override this to perform some
special initialisation upon being decoded.
- (Class)
class;
Availability: OpenStep
Returns the class of which the receiver is an
instance.
The default implementation
returns the private isa
instance
variable of NSObject, which is used to store a
pointer to the objects class.
NB. When
NSZombie is enabled (see NSDebug.h) this pointer
is changed upon object deallocation.
- (Class)
classForArchiver;
Availability: OpenStep
Override to substitute class when an instance is
being archived by an
NSArchiver
. Default implementation returns
-classForCoder
.
- (Class)
classForCoder;
Availability: OpenStep
Override to substitute class when an instance is
being serialized by an
NSCoder
. Default implementation returns
[self class]
(no substitution).
- (
NSString*)
className;
Availability: MacOS-X 10.0.0
Returns the name of the class of the receiving
object by using the
NSStringFromClass()
function.
This is a MacOS-X addition for
apple scripting, which is also generally useful.
- (BOOL)
conformsToProtocol: (Protocol*)aProtocol;
Availability: OpenStep
Returns a flag to say whether the class of the
receiver conforms to aProtocol.
- (id)
copy;
Availability: OpenStep
- (void)
dealloc;
Availability: OpenStep
Deallocates the receiver by calling
NSDeallocateObject()
with self as the argument.
You should normally call the superclass
implementation of this method when you
override it in a subclass, or the memory
occupied by your object will not be released.
NSObject
's implementation of this
method destroys the receiver, by returning the
memory allocated to the receiver to the system.
After this method has been called on an instance,
you must not refer the instance in any way, because
it does not exist any longer. If you do, it is a bug
and your program might even crash with a segmentation
fault.
If you have turned on the debugging facilities for
instance allocation, NSObject
's
implementation of this method will also
update the various counts and monitors of
allocated instances (see the
GSDebugAllocation...
functions for
more info).
Normally you are supposed to manage the memory
taken by objects by using the high level interface
provided by the retain
,
release
and autorelease
methods (or better by the corresponding macros
RETAIN
, RELEASE
and
AUTORELEASE
), and by autorelease
pools and such; whenever the release/autorelease
mechanism determines that an object is no
longer needed (which happens when its retain count
reaches 0), it will call the dealloc
method to actually deallocate the object. This
means that normally, you should not need to call
dealloc
directly as the gnustep base
library automatically calls it for you when the
retain count of an object reaches 0.
Because the dealloc
method will be
called when an instance is being destroyed, if
instances of your subclass use objects or
resources (as it happens for most useful
classes), you must override
dealloc
in subclasses to release all
objects and resources which are used by the
instance, otherwise these objects and resources
would be leaked. In the subclass implementation,
you should first release all your subclass specific
objects and resources, and then invoke super's
implementation (which will do the same,
and so on up in the class hierarchy to
NSObject
's implementation, which
finally destroys the object). Here is an example
of the implementation of dealloc
for a
subclass whose instances have a single instance
variable name
which needs to be
released when an instance is deallocated:
- (void) dealloc {RELEASE (name);
[super dealloc];}
dealloc
might contain code to release
not only objects, but also other resources, such as
open files, network connections, raw memory
allocated in other ways, etc.
If you have allocated the memory using a non-standard
mechanism, you will not call the superclass
(NSObject) implementation of the method as you
will need to handle the deallocation specially.
In some circumstances, an object may wish
to prevent itself from being deallocated, it can do
this simply be refraining from calling the
superclass implementation.
- (
NSString*)
description;
Availability: OpenStep
Returns a string describing the receiver. The
default implementation gives the class and memory
location of the receiver.
- (void)
doesNotRecognizeSelector: (SEL)aSelector;
Availability: OpenStep
Raises an invalid argument exception providing
information about the receivers inability to
handle aSelector.
- (void)
finalize;
Availability: Not in OpenStep/MacOS-X
On a system which performs garbage collection, you
should implement this method to execute code when
the receiver is collected.
You must not call
this method yourself (except when a subclass calls the
superclass method within its own
implementation).
- (void)
forwardInvocation: (
NSInvocation*)anInvocation;
Availability: OpenStep
This method is called automatically to handle a
message sent to the receiver for which the
receivers class has no method.
The default
implementation calls
-doesNotRecognizeSelector:
- (unsigned)
hash;
Availability: OpenStep
Returns the hash of the receiver. Subclasses should
ensure that their implementations of this method
obey the rule that if the
-isEqual:
method returns
YES
for two instances of
the class, the
-hash
method returns the same value for both instances.
The default implementation returns a value
based on the address of the instance.
- (id)
init;
Availability: OpenStep
Initialises the receiver... the NSObject
implementation simply returns self.
- (BOOL)
isEqual: (id)anObject;
Availability: OpenStep
Tests
anObject and the receiver for
equality. The default implementation considers
two objects to be equal only if they are the same
object (ie occupy the same memory location).
If a subclass overrides this method, it should also
override the
-hash
method so that if two objects are equal they both
have the same hash.
- (BOOL)
isKindOfClass: (Class)aClass;
Availability: OpenStep
Returns YES
if the class of the
receiver is either the same as aClass
or is derived from (a subclass of) aClass.
- (BOOL)
isMemberOfClass: (Class)aClass;
Availability: OpenStep
Returns YES
if the class of the
receiver is aClass
- (BOOL)
isProxy;
Availability: OpenStep
Returns a flag to differentiate between 'true'
objects, and objects which are proxies for other
objects (ie they forward messages to the other
objects).
The default implementation
returns NO
.
- (IMP)
methodForSelector: (SEL)aSelector;
Availability: OpenStep
Returns a pointer to the C function implementing
the method used to respond to messages with
aSelector.
Raises
NSInvalidArgumentException if
given a null selector.
- (
NSMethodSignature*)
methodSignatureForSelector: (SEL)aSelector;
Availability: OpenStep
Returns the method signature describing how the
receiver would handle a message with
aSelector.
Raises
NSInvalidArgumentException if
given a null selector.
- (id)
mutableCopy;
Availability: OpenStep
- (id)
performSelector: (SEL)aSelector;
Availability: OpenStep
Causes the receiver to execute the method
implementation corresponding to
aSelector and returns the result.
The method must be one which takes no arguments and
returns an object.
Raises
NSInvalidArgumentException if
given a null selector.
- (id)
performSelector: (SEL)aSelector
withObject: (id)anObject;
Availability: OpenStep
Causes the receiver to execute the method
implementation corresponding to
aSelector and returns the result.
The method must be one which takes one argument and
returns an object.
Raises
NSInvalidArgumentException if
given a null selector.
- (id)
performSelector: (SEL)aSelector
withObject: (id)object1
withObject: (id)object2;
Availability: OpenStep
Causes the receiver to execute the method
implementation corresponding to
aSelector and returns the result.
The method must be one which takes two arguments and
returns an object.
Raises
NSInvalidArgumentException if
given a null selector.
- (void)
release;
Availability: OpenStep
Decrements the retain count for the receiver if
greater than zero, otherwise calls the dealloc
method instead.
The default implementation
calls the
NSDecrementExtraRefCountWasZero()
function to test the extra reference count for the
receiver (and decrement it if non-zero) - if the
extra reference count is zero then the retain count
is one, and the dealloc method is called.
In
GNUstep, the
[NSObject +enableDoubleReleaseCheck:]
method may be used to turn on checking for ratain/release errors in this method.
- (id)
replacementObjectForArchiver: (
NSArchiver*)anArchiver;
Availability: OpenStep
- (id)
replacementObjectForCoder: (
NSCoder*)anEncoder;
Availability: OpenStep
Override to substitute another object for this
instance when being serialized by given
NSCoder
. Default implementation returns
self
.
- (BOOL)
respondsToSelector: (SEL)aSelector;
Availability: OpenStep
Returns a flag to say if the receiver will respond
to the specified selector. This ignores situations where
a subclass implements
-forwardInvocation:
to respond to selectors not normally handled... in these
cases the subclass may override this method to handle
it.
If given a null selector, raises
NSInvalidArgumentException when
in MacOS-X compatibility more, or returns
NO
otherwise.
- (id)
retain;
Availability: OpenStep
Increments the reference count and returns the
receiver.
The default implementation does
this by calling
NSIncrementExtraRefCount()
- (unsigned)
retainCount;
Availability: OpenStep
Returns the reference count for the receiver. Each
instance has an implicit reference count of 1, and
has an 'extra reference count' returned by the
NSExtraRefCount()
function, so the value returned by this method is
always greater than zero.
By convention,
objects which should (or can) never be deallocated
return the maximum
unsigned integer
value.
- (id)
self;
Availability: OpenStep
Returns the receiver.
- (Class)
superclass;
Availability: OpenStep
Returns the super class from which the receivers
class was derived.
- (
NSZone*)
zone;
Availability: OpenStep
Returns the memory allocation zone in which the
receiver is located.
Instance Variables for NSObject Class
@protected Class isa;
Availability: OpenStep
Points to instance's class. Used by runtime to
access method implementations, etc.. Set in
+alloc
, Unlike other instance variables, which are cleared
there.
- Declared in:
- Foundation/NSObject.h
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Some non-standard extensions mainly needed for backwards
compatibility and internal utility reasons.
Method summary
+ (Class)
autoreleaseClass;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
returns the class used to autorelease objects.
+ (void)
enableDoubleReleaseCheck: (BOOL)enable;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Enables runtime checking of
retain/release/autorelease
operations.
Whenever either
-autorelease
or -release
is
called, the contents of any autorelease pools
will be checked to see if there are more outstanding
release operations than the objects retain count.
In which case an exception is raised to say that the
object is released too many times.
Beware, since this feature
entails examining all active autorelease pools
every time an object is released or autoreleased,
it can cause a massive performance degradation... it
should only be enabled for debugging.
When you are having memory allocation problems, it
may make more sense to look at the memory allocation
debugging functions documented in NSDebug.h, or
use the NSZombie features.
+ (void)
setAutoreleaseClass: (Class)aClass;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Called to change the class used for autoreleasing
objects.
- (BOOL)
isInstance;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Description forthcoming.
- (id)
makeImmutableCopyOnFail: (BOOL)force;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Transmutes the receiver into an immutable
version of the same object and returns the result.
If the receiver is not a mutable object or
cannot be simply transmuted, then this method either
returns the receiver unchanged or, if the
force flag is set to YES
,
returns an autoreleased copy of the receiver.
Mutable classes should override this default
implementation.
This method is used
in methods which are declared to return immutable
objects (eg. an NSArray), but which create and
build mutable ones internally.
- (id)
read: (TypedStream*)aStream;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Originally used to read the instance variables
declared in this particular part of the object
from a stream. Currently stubbed out.
- (Class)
transmuteClassTo: (Class)aClassObject;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Changes the class of the receiver (the 'isa'
pointer) to be aClassObject, but only
if the receiver is an instance of a subclass of
aClassObject which has not added extra
instance variables.
Returns zero on
failure, or the old class on success.
- (id)
write: (TypedStream*)aStream;
Availability: Not in OpenStep/MacOS-X, Base Likely to be changed/moved/removed at 1.17.0
Originally used to write the instance variables
declared in this particular part of the object to
a stream. Currently stubbed out.
- Declared in:
- Foundation/NSObject.h
Availability: Not in OpenStep/MacOS-X
Provides a number of GNUstep-specific methods that
are used to aid implementation of the Base library.
Extension methods for the NSObject class
Method summary
- (
NSComparisonResult)
compare: (id)anObject;
Availability: Not in OpenStep/MacOS-X
WARNING: The
-compare:
method for NSObject is deprecated due to subclasses
declaring the same selector with conflicting
signatures. Comparison of arbitrary objects is
not just meaningless but also dangerous as most
concrete implementations expect comparable objects
as arguments often accessing instance variables
directly. This method will be removed in a future
release.
WARNING: The
-compare:
method for NSObject is deprecated due to subclasses
declaring the same selector with conflicting
signatures. Comparison of arbitrary objects is
not just meaningless but also dangerous as most
concrete implementations expect comparable objects
as arguments often accessing instance variables
directly. This method will be removed in a future
release.
- (id)
notImplemented: (SEL)aSel;
Availability: Not in OpenStep/MacOS-X
Message sent when an implementation wants to
explicitly exclude a method (but cannot due to
compiler constraint), and wants to make sure it is
not called by mistake. Default implementation raises an
exception at runtime.
- (id)
shouldNotImplement: (SEL)aSel;
Availability: Not in OpenStep/MacOS-X
Message sent when an implementation wants to
explicitly exclude a method (but cannot due to
compiler constraint) and forbid that subclasses
implement it. Default implementation raises an
exception at runtime. If a subclass does
implement this method, however, the superclass's
implementation will not be called, so this
is not a perfect mechanism.
- (id)
subclassResponsibility: (SEL)aSel;
Availability: Not in OpenStep/MacOS-X
Message sent when an implementation wants to
explicitly require a subclass to implement a
method (but cannot at compile time since there is no
abstract
keyword in Objective-C).
Default implementation raises an exception at
runtime to alert developer that he/she forgot to
override a method.
- Declared in:
- Foundation/NSObject.h
Availability: Not in OpenStep/MacOS-X
Methods for compatibility with the NEXTSTEP
(pre-OpenStep) 'Object' class.
Method summary
- (id)
error: (const char*)aString
,...;
Availability: Not in OpenStep/MacOS-X
Logs a message.
Deprecated. Use
NSLog()
in new code.
- Declared in:
- Foundation/NSObject.h
Availability: OpenStep
Declares some methods for sending messages to self
after a fixed delay. (These methods are in
OpenStep and OS X.)
Method summary
+ (void)
cancelPreviousPerformRequestsWithTarget: (id)obj;
Availability: OpenStep
Cancels any perform operations set up for the
specified target in the current run loop.
+ (void)
cancelPreviousPerformRequestsWithTarget: (id)obj
selector: (SEL)s
object: (id)arg;
Availability: OpenStep
Cancels any perform operations set up for the
specified target in the current loop, but only if
the value of aSelector and argument with which the
performs were set up match those supplied.
Matching of the argument may be either by pointer
equality or by use of the
[NSObject -isEqual:]
method.
- (void)
performSelector: (SEL)s
withObject: (id)arg
afterDelay: (
NSTimeInterval)seconds;
Availability: OpenStep
Sets given message to be sent to this instance after
given delay, in any run loop mode. See
NSRunLoop
.
- (void)
performSelector: (SEL)s
withObject: (id)arg
afterDelay: (
NSTimeInterval)seconds
inModes: (
NSArray*)modes;
Availability: OpenStep
Sets given message to be sent to this instance after
given delay, in given run loop
modes. See
NSRunLoop
.
- Declared in:
- Foundation/NSObject.h
Availability: OpenStep
This protocol must be adopted by any class wishing to
support saving and restoring instances to an archive,
or copying them to remote processes via the Distributed
Objects mechanism.
Method summary
- (void)
encodeWithCoder: (
NSCoder*)aCoder;
Availability: OpenStep
Called when it is time for receiver to be serialized
for writing to an archive or network connection.
Receiver should record all of its instance
variables using methods on
aCoder. See
documentation for
NSCoder
,
NSArchiver
,
NSKeyedArchiver
, and/or
NSPortCoder
for more information.
- (id)
initWithCoder: (
NSCoder*)aDecoder;
Availability: OpenStep
Called on a freshly allocated receiver when it is
time to reconstitute from serialized bytes in an
archive or from a network connection. Receiver
should load all of its instance variables using
methods on aCoder. See documentation for
NSCoder
,
NSUnarchiver
,
NSKeyedUnarchiver
, and/or
NSPortCoder
for more information.
- Declared in:
- Foundation/NSObject.h
Availability: OpenStep
This protocol must be adopted by any class wishing to
support copying - ie where instances of the class
should be able to create new instances which are
copies of the original and, where a class has mutable
and immutable versions, where the copies are immutable.
Method summary
- (id)
copyWithZone: (
NSZone*)zone;
Availability: OpenStep
Called by
[NSObject -copy]
passing
NSDefaultMallocZone()
as
zone.
This method returns a copy of
the receiver and, where the receiver is a mutable
variant of a class which has an immutable partner
class, the object returned is an instance of that
immutable class.
The new object is
not autoreleased, and is considered to be
'owned' by the calling code... which is therefore
responsible for releasing it.
In the
case where the receiver is an instance of a container
class, it is undefined whether contained objects are
merely retained in the new copy, or are themselves
copied, or whether some other mechanism entirely is
used.
- Declared in:
- Foundation/NSObject.h
Availability: OpenStep
This protocol must be adopted by any class wishing to
support mutable copying - ie where instances of the
class should be able to create mutable copies of
themselves.
Method summary
- (id)
mutableCopyWithZone: (
NSZone*)zone;
Availability: OpenStep
Called by
[NSObject -mutableCopy]
passing
NSDefaultMallocZone()
as
zone.
This method returns a copy of
the receiver and, where the receiver is an immutable
variant of a class which has a mutable partner
class, the object returned is an instance of that
mutable class. The new object is
not
autoreleased, and is considered to be 'owned'
by the calling code... which is therefore responsible
for releasing it.
In the case where the receiver
is an instance of a container class, it is undefined
whether contained objects are merely retained in
the new copy, or are themselves copied, or whether some
other mechanism entirely is used.
- Declared in:
- Foundation/NSObject.h
Availability: OpenStep
The NSObject protocol describes a minimal set of methods
that all objects are expected to support. You should be
able to send any of the messages listed in this protocol
to an object, and be safe in assuming that the receiver
can handle it.
Method summary
- (id)
autorelease;
Availability: OpenStep
- (Class)
class;
Availability: OpenStep
- (BOOL)
conformsToProtocol: (Protocol*)aProtocol;
Availability: OpenStep
- (
NSString*)
description;
Availability: OpenStep
- (unsigned)
hash;
Availability: OpenStep
- (BOOL)
isEqual: (id)anObject;
Availability: OpenStep
- (BOOL)
isKindOfClass: (Class)aClass;
Availability: OpenStep
- (BOOL)
isMemberOfClass: (Class)aClass;
Availability: OpenStep
- (BOOL)
isProxy;
Availability: OpenStep
- (id)
performSelector: (SEL)aSelector;
Availability: OpenStep
- (id)
performSelector: (SEL)aSelector
withObject: (id)anObject;
Availability: OpenStep
- (id)
performSelector: (SEL)aSelector
withObject: (id)object1
withObject: (id)object2;
Availability: OpenStep
- (oneway void)
release;
Availability: OpenStep
- (BOOL)
respondsToSelector: (SEL)aSelector;
Availability: OpenStep
- (id)
retain;
Availability: OpenStep
- (unsigned)
retainCount;
Availability: OpenStep
- (id)
self;
Availability: OpenStep
- (Class)
superclass;
Availability: OpenStep
- (
NSZone*)
zone;
Availability: OpenStep
Up