我需要获取与iPhone连接的wifi网络的网关地址.谁知道怎么做到这一点?
只是为了澄清,我正在寻找这个屏幕的信息:

谢谢.
我试着以这种方式获取路由器地址.
- (NSString *) routerIp {
NSString *address = @"error";
struct ifaddrs *interfaces = NULL;
struct ifaddrs *temp_addr = NULL;
int success = 0;
// retrieve the current interfaces - returns 0 on success
success = getifaddrs(&interfaces);
if (success == 0)
{
// Loop through linked list of interfaces
temp_addr = interfaces;
while(temp_addr != NULL)
{
if(temp_addr->ifa_addr->sa_family == AF_INET)
{
// Check if interface is en0 which is the wifi connection on the iPhone
if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"])
{
// Get …Run Code Online (Sandbox Code Playgroud) 我需要在iPhone应用程序中获取默认网关的IP地址.我找不到合适的API.有人知道iPhone是否公开了这些信息?