[英]Get IP Address of Device connected to my iPhone's Personal Hotspot using Swift
[英]Get iPhone's IP Address
我正在尝试获取设备的IP地址,但没有运气。 我可以在Google和SO上找到的所有方法均无效。
例如,最新答案
https://stackoverflow.com/a/14084031/975959
我收到编译错误:
使用未声明的标识符“ getifaddrs”
和
使用未声明的标识符“ freeifaddrs”
我和问这个问题的人有同样的问题。 gethostname()
返回*****s-iPhone
,并在此行中使用它struct hostent *host = gethostbyname(...)
返回NULL
我正在使用该设备,但是我猜编译错误与它无关。
有什么想法吗?
如果有问题,我使用的是Base SDK 6.0,部署目标是5.0
你必须包括那些
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <netdb.h>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.