How to get ip address from NSNetService
- by Vic
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.