I’m trying to obtain the device’s IP Address with no luck.
All the methods I could find on Google and SO doesn’t work.
For example, most recent answer
https://stackoverflow.com/a/14084031/975959
I’m getting compilation errors:
Use of undeclared identifier ‘getifaddrs’
and
Use of undeclared identifier ‘freeifaddrs’
The I’m having the same problem as the one who asked this question.
gethostname() return *****s-iPhone and using it in this line struct hostent *host = gethostbyname(...) returns NULL
I’m working on the device, but I guess compilation errors has nothing to do with it.
Any thoughts?
P.S.
If it matters, I’m using Base SDK 6.0, deployment target 5.0
You have to include those