| 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 NSNetServiceBrowserDelegate protocol defines the optional methods implemented by delegates of NSNetServiceBrowser objects.
Tells the delegate the sender found a domain.
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindDomain:(NSString *)domainName moreComing:(BOOL)moreDomainsComing
Sender of this delegate message.
Name of the domain found by netServiceBrowser.
YES when netServiceBrowser is waiting for additional domains. NO when there are no additional domains.
The delegate uses this message to compile a list of available domains. It should wait until moreDomainsComing is NO to do a bulk update of user interface elements.
– searchForBrowsableDomains (NSNetServiceBrowser)– searchForRegistrationDomains (NSNetServiceBrowser)NSNetServices.hTells the delegate the sender found a service.
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindService:(NSNetService *)netService moreComing:(BOOL)moreServicesComing
Sender of this delegate message.
Network service found by netServiceBrowser. The delegate can use this object to connect to and use the service.
YES when netServiceBrowser is waiting for additional services. NO when there are no additional services.
The delegate uses this message to compile a list of available services. It should wait until moreServicesComing is NO to do a bulk update of user interface elements.
If the delegate chooses to resolve netService, it should retain netService and set itself as that service’s delegate. The delegate should, therefore, release that service when it receives the netServiceDidResolveAddress: or netService:didNotResolve: delegate messages of the NSNetService class.
– searchForServicesOfType:inDomain: (NSNetServiceBrowser)NSNetServices.hTells the delegate that a search was not successful.
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didNotSearch:(NSDictionary *)errorInfo
Sender of this delegate message.
Dictionary with the reasons the search was unsuccessful. Use the dictionary keys NSNetServicesErrorCode and NSNetServicesErrorDomain to retrieve the error information from the dictionary.
NSNetServices.hTells the delegate the a domain has disappeared or has become unavailable.
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didRemoveDomain:(NSString *)domainName moreComing:(BOOL)moreDomainsComing
Sender of this delegate message.
Name of the domain that became unavailable.
YES when netServiceBrowser is waiting for additional domains. NO when there are no additional domains.
The delegate uses this message to compile a list of unavailable domains. It should wait until moreDomainsComing is NO to do a bulk update of user interface elements.
NSNetServices.hTells the delegate a service has disappeared or has become unavailable.
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didRemoveService:(NSNetService *)netService moreComing:(BOOL)moreServicesComing
Sender of this delegate message.
Network service that has become unavailable.
YES when netServiceBrowser is waiting for additional services. NO when there are no additional services.
The delegate uses this message to compile a list of unavailable services. It should wait until moreServicesComing is NO to do a bulk update of user interface elements.
NSNetServices.hTells the delegate that a search was stopped.
- (void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)netServiceBrowser
Sender of this delegate message.
When netServiceBrowser receives a stop message from its client, netServiceBrowser sends a netServiceBrowserDidStopSearch: message to its delegate. The delegate then performs any necessary cleanup.
– stop (NSNetServiceBrowser)NSNetServices.hTells the delegate that a search is commencing.
- (void)netServiceBrowserWillSearch:(NSNetServiceBrowser *)netServiceBrowser
Sender of this delegate message.
This message is sent to the delegate only if the underlying network layer is ready to begin a search. The delegate can use this notification to prepare its data structures to receive data.
NSNetServices.hLast updated: 2009-04-18