<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/instanceMethod(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(cm)instanceMethodForSelector:"
  },
  "title" : "instanceMethod(for:)"
}
-->

# instanceMethod(for:)

Locates and returns the address of the implementation of the instance method identified by a given selector.

```
class func instanceMethod(for aSelector: Selector!) -> IMP!
```

## Parameters

`aSelector`

A [Selector](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Selector.html#//apple_ref/doc/uid/TP40008195-CH48) that identifies the method for which to return the implementation address. The selector must be non-`NULL` and valid for the receiver. If in doubt, use the [`responds(to:)`](/documentation/ObjectiveC/NSObjectProtocol/responds(to:)) method to check before passing the selector to [`method(for:)`](/documentation/ObjectiveC/NSObject-swift.class/method(for:)).

## Return Value

The address of the implementation of the `aSelector` instance method.

## Discussion

An error is generated if instances of the receiver can’t respond to `aSelector` messages.

Use this method to ask the class object for the implementation of instance methods only. To ask the class for the implementation of a class method, send the [`method(for:)`](/documentation/ObjectiveC/NSObject-swift.class/method(for:)) instance method to the class instead.

---

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)