Getting IP Address of NIC
Is there any official way to get the I开发者_JAVA技巧P Address of NIC ?
I found a way with the use of getIfAddrs. But it seems that it is not mentioned in SDK. So is the risk (banned by AppStore) high ?
Thanks.
Speaking to the use of getIfAddrs(3)
, as a BSD system call, it's not a private API, so its use should not be prohibited in any way.
never tried before, but i kept reference of this function to retrieve ip address. it might work
http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone
精彩评论