• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting IP Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Getting IP Address (From: "David Cornell" <email@hidden>)

  • Prev by Date: Re: Finder duplicating my doc package as folder
  • Next by Date: Video Card model name?
  • Previous by thread: Getting IP Address
  • Next by thread: Re: Getting IP Address
  • Index(es):
    • Date
    • Thread