I want to be able to list the names of devices on the local network from a device running iPhone OS 3.x (iPhone / iPad). I tried using NSNetServiceBrowser to find all such services:
[serviceBrowser searchForServicesOfType:@"_services._dns-sd._udp." inDomain:@"local."];
this returns results, but when I try to resolve the addresses, I get the following errors:
NSNetServicesErrorCode = -72004; NSNetServicesErrorDomain = 10;
I was looking for a mistake and it seems like there is a bad argument?
[kCFNetServiceErrorBadArgument A required argument was not provided or was not valid.]
if I search for a specific service, for example [serviceBrowser searchForServicesOfType:@"_ipp._tcp." inDomain:@""]; [serviceBrowser searchForServicesOfType:@"_ipp._tcp." inDomain:@""]; works fine.
So, am I on the right track with NSNetServiceBrowser or is there some other method that will allow me to list the names of devices connected to my network?
objective-c iphone cocoa-touch networking
withakay
source share