Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSHost currentHost always returns localhost?



When I try:

NSHost *host = [NSHost currentHost];
NSArray *addresses = [host addresses];
NSArray *names = [host names];

I always get a single address (127.0.0.1) and a single name (localhost). Somehow I thought I'd get more - such as my en0 ip address. Am I missing something?

What's the approved method for getting my en0 address from Cocoa? Should I run ifconfig and grep the results?

/Clyde




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.