I have an IP address stored in in_addr_t and I want to create the corresponding string representation of this data type (e.g. in_addr_t to 10.0.0
in_addr_t
10.0.0
-(NSString*)long2ip:(uint32_t)ip { char str[40]; struct in_addr myaddr; myaddr.s_addr = htonl(ip); if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) { return [NSString stringWithFormat:@"%s",str]; } else { return nil; } }