NSHost class
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.