• 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: Scott Thompson <email@hidden>
  • Date: Wed, 21 Jul 2004 20:49:11 -0500

On 20 Jul, 2004, at 10:07 PM, David Cornell wrote:

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

Hee hee he... the fe80::1 address is the "real IP" address. It just happens to be the IPv6 address. The wave of the future!

Are you calling something like [[NSHost currentHost] addresses]? If so then you should get the IPv4 address as part of that. One of them should be a dotted string of numbers similar to the one you are looking for.

Unfortuantely, your machine may have more than one IP address as another poster mentioned. My laptop, for example, could have up to three. One for Airport, one for the wired ethernet, and one for the Bluetooth modem connection. I've never tried having all three up at once (might be interesting though).

Scott
_______________________________________________
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>)
 >Re: Getting IP Address (From: Dustin Voss <email@hidden>)

  • Prev by Date: Drawing strings at 20fps
  • Next by Date: NSTask Permission denied
  • Previous by thread: Re: Getting IP Address
  • Next by thread: Re: Getting IP Address
  • Index(es):
    • Date
    • Thread