• 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: IP of a connected Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IP of a connected Mac


  • Subject: Re: IP of a connected Mac
  • From: Smith Kennedy <email@hidden>
  • Date: Mon, 6 Jan 2003 12:22:00 -0700

That's true, and it is unfortunate that the code snippet I threw out there won't return the "default" interface. Seems like a logical thing for that method to return, but the documentation says it will be "an arbitrary Internet address of the receiver".


On Monday, January 6, 2003, at 11:12 AM, Joshua Graessley wrote:


That will not work. It is important to note that the computer may have more than one IP address on more than one interface. The code below would only return one IP address.

-josh

On Monday, January 6, 2003, at 07:38 AM, Smith Kennedy wrote:

This might work:

NSString *myAddress = [[NSHost currentHost] address];
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: IP of a connected Mac (From: Joshua Graessley <email@hidden>)

  • Prev by Date: Re: IP of a connected Mac
  • Next by Date: Re: IP of a connected Mac
  • Previous by thread: Re: IP of a connected Mac
  • Next by thread: Re: IP of a connected Mac
  • Index(es):
    • Date
    • Thread