Re: Getting IP Address
Re: Getting IP Address
- Subject: Re: Getting IP Address
- From: Yann Bizeul <email@hidden>
- Date: Wed, 21 Jul 2004 10:11:34 +0200
The documentation say :
address
Returns an arbitrary Internet address of the receiver as an
NSStringfor example, 192.42.172.1 or fe80::1.
addresses
Returns all the Internet addresses of the receiver as NSStringsfor
example, 192.42.172.1 or fe80::1.
So you can't trust the first to give you an IPv4 address if there is
also an IPv6 present.
I would use addrsses: and try to match IPv4 addresses (presence of "."
character ?)
Le 21 juil. 04, ` 07:07, David Cornell a icrit :
>
Hey, total newb here...
>
>
How do I get the dotted ip address of the currenthost, I'm currently
>
using
>
NSHost but I get fe80::1. I need to get the real IP, such as
>
192.168.100.12
>
etc.
>
>
thanks in advance!
>
dave
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
>
>
>
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.