• 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
NSHost class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSHost class


  • Subject: NSHost class
  • From: joseph <email@hidden>
  • Date: Sat, 17 Jul 2004 17:56:07 +0200

Hello,

I try to get back the IP address of my computer using these lines of
code :


- (IBAction)GetIPAction:(id)sender
{
[NSHost flushHostCache];
[IPTextFielOutlet setStringValue:[[NSHost currentHost] address]];
}


where "GetIPAction" is the method wich is lunched when a button is
pressed
and "IPTextFielOutlet" is a NSTextField instance.

The first time I run the App. everything is OK : when I press the button
the IP addres is displayed in the textfield.

If I disconnect and then connect again my computer from the internet,
getting
another IP address, and then press the button once again, the IP address
remains the same, even if it has realy changed.

I am a beginner in MAC OS X and COCOA dev. So I'm sure that something is
wrong in my code ... but I don't see where !!!

Thanks a lot for your help,
joseph
_______________________________________________
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.


  • Prev by Date: Re: Preferences Panel: No Progress
  • Next by Date: Re: Applescript error - NSCannotCreateScriptCommandError
  • Previous by thread: Re: Tiger CD to ADC members?
  • Next by thread: Re: NSHost class
  • Index(es):
    • Date
    • Thread