<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObjectProtocol",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(pl)NSObject"
  },
  "title" : "NSObjectProtocol"
}
-->

# NSObjectProtocol

The group of methods that are fundamental to all Objective-C objects.

```
protocol NSObjectProtocol
```

## Overview> Note:
> This protocol is imported into Swift with the name `NSObjectProtocol`.

An object that conforms to this protocol can be considered a first-class object. Such an object can be asked about its:

- Class, and the place of its class in the inheritance hierarchy.
- Conformance to protocols.
- Ability to respond to a particular message.

The Cocoa root class [`NSObject`](/documentation/ObjectiveC/NSObject-swift.class) adopts this protocol, so all objects inheriting from [`NSObject`](/documentation/ObjectiveC/NSObject-swift.class) have the features described by this protocol.

## Topics

### Identifying Classes

[`class`](/documentation/ObjectiveC/NSObject-c.protocol/class)

Returns the class object for the receiver’s class.

[`superclass`](/documentation/ObjectiveC/NSObjectProtocol/superclass)

Returns the class object for the receiver’s superclass.

### Identifying and Comparing Objects

[`isEqual(_:)`](/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:))

Returns a Boolean value that indicates whether the receiver and a given object are equal.

[`hash`](/documentation/ObjectiveC/NSObjectProtocol/hash)

Returns an integer that can be used as a table address in a hash table structure.

[`self()`](/documentation/ObjectiveC/NSObjectProtocol/self())

Returns the receiver.

### Testing Object Inheritance, Behavior, and Conformance

[`isKind(of:)`](/documentation/ObjectiveC/NSObjectProtocol/isKind(of:))

Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.

[`isMember(of:)`](/documentation/ObjectiveC/NSObjectProtocol/isMember(of:))

Returns a Boolean value that indicates whether the receiver is an instance of a given class.

[`responds(to:)`](/documentation/ObjectiveC/NSObjectProtocol/responds(to:))

Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.

[`conforms(to:)`](/documentation/ObjectiveC/NSObjectProtocol/conforms(to:))

Returns a Boolean value that indicates whether the receiver conforms to a given protocol.

### Describing Objects

[`description`](/documentation/ObjectiveC/NSObjectProtocol/description)

A textual representation of the receiver.

[`debugDescription`](/documentation/ObjectiveC/NSObjectProtocol/debugDescription)

A textual representation of the receiver to use with a debugger.

### Sending Messages

[`perform(_:)`](/documentation/ObjectiveC/NSObjectProtocol/perform(_:))

Sends a specified message to the receiver and returns the result of the message.

[`perform(_:with:)`](/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:))

Sends a message to the receiver with an object as the argument.

[`perform(_:with:with:)`](/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:with:))

Sends a message to the receiver with two objects as arguments.

### Identifying Proxies

[`isProxy()`](/documentation/ObjectiveC/NSObjectProtocol/isProxy())

Returns a Boolean value that indicates whether the receiver does not descend from [`NSObject`](/documentation/ObjectiveC/NSObject-swift.class).

### Obsolete Methods

[`retain`](/documentation/ObjectiveC/NSObject-c.protocol/retain)

Increments the receiver’s reference count.

[`release`](/documentation/ObjectiveC/NSObject-c.protocol/release)

Decrements the receiver’s reference count.

[`autorelease`](/documentation/ObjectiveC/NSObject-c.protocol/autorelease)

Decrements the receiver’s retain count at the end of the current autorelease pool block.

[`retainCount`](/documentation/ObjectiveC/NSObject-c.protocol/retainCount)

Do not use this method.

[`zone`](/documentation/ObjectiveC/NSObject-c.protocol/zone)

Zones are deprecated and ignored by most classes that have it as a parameter.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)
