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

# setDelegateQueue(_:)

Determines the operation queue that is used to call methods on the connection’s delegate.

```
func setDelegateQueue(_ queue: OperationQueue?)
```

## Parameters

`queue`

The operation queue to use when calling delegate methods.

## Discussion

By default, a connection is scheduled on the current thread in the default mode when it is created. If you create a connection with the [`init(request:delegate:startImmediately:)`](/documentation/Foundation/NSURLConnection/init(request:delegate:startImmediately:)) method and provide <doc://com.apple.documentation/documentation/Swift/false> for the `startImmediately` parameter, you can instead schedule the connection on an operation queue before starting it with the [`start()`](/documentation/Foundation/NSURLConnection/start()) method.

You cannot reschedule a connection after it has started.

It is an error to schedule delegate method calls with both this method and the [`schedule(in:forMode:)`](/documentation/Foundation/NSURLConnection/schedule(in:forMode:)) method.

---

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)