iOS. get other device/computer name by IP in the same local network
问题 One task of my program is to scan local wi-fi network for any devices/computers in same network. I found solution to get all working devices IPs, but did not managed to get names of them. I did not find any clue to solve this problem. Any suggestions? 回答1: In order to perform a reverse DNS lookup, you need to call the CFHostGetNames function, like this: + (NSArray *)hostnamesForIPv4Address:(NSString *)address { struct addrinfo *result = NULL; struct addrinfo hints; memset(&hints, 0, sizeof