Starts a search for services of a particular type within a specific domain.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
Type of the service to search for.
Domain name in which to perform the search.
This method returns immediately, sending a
net message to the delegate if the network was ready to initiate the search.The delegate receives subsequent
net messages for each service discovered.
service argument must contain both the service type and transport layer information. To ensure that the mDNS responder searches for services, rather than hosts, make sure to prefix both the service name and transport layer name with an underscore character (“_”). For example, to search for an HTTP service on TCP, you would use the type string “
_http“. Note that the period character at the end is required.
domain argument can be an explicit domain name, the generic local domain
@"local." (note trailing period, which indicates an absolute name), or the empty string (
@""), which indicates the default registration domains. Usually, you pass in an empty string. Note that it is acceptable to use an empty string for the
domain argument when publishing or browsing a service, but do not rely on this for resolution.