How to get ip address from NSNetService

Posted by Vic on Stack Overflow See other posts from Stack Overflow or by Vic
Published on 2012-09-24T03:35:58Z Indexed on 2012/09/24 3:37 UTC
Read the original article Hit count: 275

Filed under:
|
|
|

When I get a NSNetService object, I try to do:

NSNetService *ss=[netArray objectAtIndex:indexPath.row];
ss.delegate=self;
[ss resolveWithTimeout:3.0];

Then on the delegate method:

- (void)netServiceDidResolveAddress:(NSNetService *)sender
{
  NSArray *address=sender.addresses;
  NSData *addressData=[NSData dataWithBytes:address length:sizeof(address)];
  NSError *error;
  /*
  How?
  */
}

Thanks.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode