Mac OS X Reference Library Apple Developer
Search

NSNetServiceDelegate Protocol Reference

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

Overview

The NSNetServiceDelegate protocol defines the optional methods implemented by delegates of NSNetService objects.

Tasks

Using Network Services

Instance Methods

netService:didNotPublish:

Notifies the delegate that a service could not be published.

- (void)netService:(NSNetService *)sender didNotPublish:(NSDictionary *)errorDict

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: message has been delivered to the delegate.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h

netService:didNotResolve:

Informs the delegate that an error occurred during resolution of a given service.

- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict

Parameters
sender

The service that did not resolve.

errorDict

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

Discussion

Clients may try to resolve again upon receiving this error. For example, a DNS rotary may yield different IP addresses on different resolution requests.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h

netService:didUpdateTXTRecordData:

Notifies the delegate that the TXT record for a given service has been updated.

- (void)netService:(NSNetService *)sender didUpdateTXTRecordData:(NSData *)data

Parameters
sender

The service whose TXT record was updated.

data

The new TXT record.

Availability
  • Available in Mac OS X v10.4 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
See Also
Declared In
NSNetServices.h

netServiceDidPublish:

Notifies the delegate that a service was successfully published.

- (void)netServiceDidPublish:(NSNetService *)sender

Parameters
sender

The service that was published.

Availability
  • Available in Mac OS X v10.4 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h

netServiceDidResolveAddress:

Informs the delegate that the address for a given service was resolved.

- (void)netServiceDidResolveAddress:(NSNetService *)sender

Parameters
sender

The service that was resolved.

Discussion

The delegate can use the addresses method to retrieve the service’s address.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
See Also
Declared In
NSNetServices.h

netServiceDidStop:

Informs the delegate that a publish or resolveWithTimeout: request was stopped.

- (void)netServiceDidStop:(NSNetService *)sender

Parameters
sender

The service that stopped.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h

netServiceWillPublish:

Notifies the delegate that the network is ready to publish the service.

- (void)netServiceWillPublish:(NSNetService *)sender

Parameters
sender

The service that is ready to publish.

Discussion

Publication of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotPublish: method if an error occurs.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h

netServiceWillResolve:

Notifies the delegate that the network is ready to resolve the service.

- (void)netServiceWillResolve:(NSNetService *)sender

Parameters
sender

The service that the network is ready to resolve.

Discussion

Resolution of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotResolve: method if an error occurs.

Availability
  • Available in Mac OS X v10.2 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
NSNetServices.h



Last updated: 2009-04-18

Did this document help you? Yes It's good, but... Not helpful...