| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Apr 24, 2010
Location: Ireland
Posts: 5
![]() Mac Specs: Dual 1GHz G4 OSX10.4.11
|
|
| QUOTE Thanks | |
![]() Member Since: Apr 24, 2010
Location: Ireland
Posts: 5
![]() Mac Specs: Dual 1GHz G4 OSX10.4.11
|
It seems to be a good day for solving my own problems !
![]() After a couple of hours' fannying around, I found an easy way to do this, although it may not be foolproof on every machine: Use: NSArray *mcAddresses = [NSHost addresses]; NSString *ipv4 = [mcAddresses objectAtIndex: 1]; The 0 index of the [NSHost addresses] array is always the ipv6 extended address. The 1 index seems always to return the ipv4 address of the machine for the current location setting in System Preferences > Network, which is what most people will want, I guess. Chris |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Using a hardrive with two computers, one that has time machine, and one that does not | Troublew/macs93 | Other Hardware and Peripherals | 2 | 01-18-2010 08:59 PM |
| Time machine, space issues. | Jonik | OS X - Apps and Games | 8 | 01-04-2010 03:46 PM |
| Writing to Time Machine Backups drive from Linux | sworddude182 | Running Windows (or anything else) on your Mac | 4 | 12-12-2009 09:12 PM |
| Backing up - time machine versus third party software? | Narcosnthesis | OS X - Apps and Games | 2 | 01-06-2009 02:50 PM |
| Parallels - can't copy from Windows XP virtual machine and paste to Mac Pro | ithacalaw | Running Windows (or anything else) on your Mac | 5 | 10-22-2006 09:14 PM |
All times are GMT -4. The time now is 09:43 PM.
Powered by vBulletin