3

I'm working on an iPhone-iPad app with Objective-C. I need to get the Bonjour Address of the device. I understand this address is generated with the hostname of the device, which I've already got.

Could anybody help me?

Thanks in advance.

Mikywan.

Matt
  • 22,721
  • 17
  • 71
  • 112
mikywan
  • 1,495
  • 1
  • 19
  • 38

1 Answers1

3

see following

service = [[NSNetService alloc] initWithDomain:@"local." type:@"_music._tcp" name:serviceName];

[service setDelegate:delegateObject];

[service resolveWithTimeout:5.0]; // This code will return an address on delegate method`

following delegate methods will get fired depending on the result

 netServiceDidResolveAddress

   netService:didNotResolve:

See Docs for more detailed description

DShah
  • 9,768
  • 11
  • 71
  • 127
Sanket
  • 189
  • 1
  • 2
  • 12