<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NetServiceDelegate/netService(_:didNotPublish:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSNetServiceDelegate(im)netService:didNotPublish:"
  },
  "title" : "netService(_:didNotPublish:)"
}
-->

# netService(_:didNotPublish:)

Notifies the delegate that a service could not be published.

```
optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber])
```

## Parameters

`sender`

The service that could not be published.

`errorDict`

A dictionary containing information about the problem. The dictionary contains the keys `NSNetServicesErrorCode` and `NSNetServicesErrorDomain`.

## Discussion

This method may be called long after a [`netServiceWillPublish(_:)`](/documentation/Foundation/NetServiceDelegate/netServiceWillPublish(_:)) message has been delivered to the delegate.

---

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)