Re: NSHost class
Re: NSHost class
- Subject: Re: NSHost class
- From: joseph <email@hidden>
- Date: Sat, 17 Jul 2004 19:12:16 +0200
No this is a real IP address : 83.113.55.50 for instance
joseph
Le 17 juil. 04, ` 19:02, David Reed a icrit :
Is the IP you're getting 127.0.0.1? That's always assigned to your Mac.
David.
On Saturday, Jul 17, 2004, at 11:56 US/Eastern, joseph wrote:
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.
--
David Reed | email@hidden | AIM/iChat: parmadil01
_______________________________________________
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.