Simplemente copia pega este código y ejecutar obtendrá todas las direcciones IP que se conecta a través de la dirección IP. Marcos requeridos son
#import <sys/types.h>
#import <arpa/inet.h>
#import <netdb.h>
en viewDidLoad copiar y pegar este
int i=0;
while (i>254) {
i++;
NSString *address = [NSString stringWithFormat:@"192.168.1.%d",i];
struct hostent *he;
struct in_addr ipv4addr;
inet_pton(AF_INET, [address UTF8String], &ipv4addr);
he = gethostbyaddr(&ipv4addr, sizeof ipv4addr, AF_INET);
if (he) {
printf("Host name: %s\n", he->h_name);
NSLog(@"%@",address);
// NSLog(@"%@",address);
}
}
Did marcó [esto] (http://stackoverflow.com/questions/2113580/objective-c-how-to-fetch- the-router-address? lq = 1) ?, puede darle algunas ideas. – swiftBoy