<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSInvocationOperation/initWithTarget:selector:object:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSInvocationOperation(im)initWithTarget:selector:object:"
  },
  "title" : "initWithTarget:selector:object:"
}
-->

# initWithTarget:selector:object:

Returns an `NSInvocationOperation` object initialized with the specified target and selector.

```
- (instancetype) initWithTarget:(id) target selector:(SEL) sel object:(id) arg;
```

## Parameters

`target`

The object defining the specified selector.

`sel`

The selector to invoke when running the operation. The selector may take 0 or 1 parameters; if it accepts a parameter, the type of that parameter must be `id`. The return type of the method may be `void`, a scalar value, or an object that can be returned as an `id` type.

`arg`

The parameter object to pass to the selector. If the selector does not take an argument, specify `nil`.

## Return Value

An initialized `NSInvocationOperation` object or `nil` if the target object does not implement the specified selector.

## Discussion

If you specify a selector with a non-void return type, you can get the return value by calling the [`result`](/documentation/Foundation/NSInvocationOperation/result) method after the operation finishes executing. The receiver tells the invocation object to retain its arguments.

## See Also

  [Threading Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i)



---

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)