---
title: "netService(_:didNotPublish:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/netservicedelegate/netservice(_:didnotpublish:)"
---

# netService(_:didNotPublish:)

Notifies the delegate that a service could not be published.

## Declaration

```swift
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

Discussion This method may be called long after a netServiceWillPublish(_:) message has been delivered to the delegate.

## See Also

### Using Network Services

- [netServiceWillPublish(_:)](foundation/netservicedelegate/netservicewillpublish(_:).md)
- [netServiceDidPublish(_:)](foundation/netservicedelegate/netservicedidpublish(_:).md)
- [netServiceWillResolve(_:)](foundation/netservicedelegate/netservicewillresolve(_:).md)
- [netService(_:didNotResolve:)](foundation/netservicedelegate/netservice(_:didnotresolve:).md)
- [netServiceDidResolveAddress(_:)](foundation/netservicedelegate/netservicedidresolveaddress(_:).md)
- [netService(_:didUpdateTXTRecord:)](foundation/netservicedelegate/netservice(_:didupdatetxtrecord:).md)
- [netServiceDidStop(_:)](foundation/netservicedelegate/netservicedidstop(_:).md)
