| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.6 and later. |
| Declared in | NSNetServices.h |
| Companion guides | |
| Related sample code |
The NSNetServiceDelegate protocol defines the optional methods implemented by delegates of NSNetService objects.
Notifies the delegate that a service could not be published.
- (void)netService:(NSNetService *)sender didNotPublish:(NSDictionary *)errorDict
The service that could not be published.
A dictionary containing information about the problem. The dictionary contains the keys NSNetServicesErrorCode and NSNetServicesErrorDomain.
This method may be called long after a netServiceWillPublish: message has been delivered to the delegate.
NSNetServices.hInforms the delegate that an error occurred during resolution of a given service.
- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict
The service that did not resolve.
A dictionary containing information about the problem. The dictionary contains the keys NSNetServicesErrorCode and NSNetServicesErrorDomain.
Clients may try to resolve again upon receiving this error. For example, a DNS rotary may yield different IP addresses on different resolution requests.
NSNetServices.hNotifies the delegate that the TXT record for a given service has been updated.
- (void)netService:(NSNetService *)sender didUpdateTXTRecordData:(NSData *)data
The service whose TXT record was updated.
The new TXT record.
– startMonitoring (NSNetService)NSNetServices.hNotifies the delegate that a service was successfully published.
- (void)netServiceDidPublish:(NSNetService *)sender
The service that was published.
NSNetServices.hInforms the delegate that the address for a given service was resolved.
- (void)netServiceDidResolveAddress:(NSNetService *)sender
The service that was resolved.
The delegate can use the addresses method to retrieve the service’s address.
– addresses (NSNetService)NSNetServices.hInforms the delegate that a publish or resolveWithTimeout: request was stopped.
- (void)netServiceDidStop:(NSNetService *)sender
The service that stopped.
NSNetServices.hNotifies the delegate that the network is ready to publish the service.
- (void)netServiceWillPublish:(NSNetService *)sender
The service that is ready to publish.
Publication of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotPublish: method if an error occurs.
NSNetServices.hNotifies the delegate that the network is ready to resolve the service.
- (void)netServiceWillResolve:(NSNetService *)sender
The service that the network is ready to resolve.
Resolution of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotResolve: method if an error occurs.
NSNetServices.hLast updated: 2009-04-18