Objective-C function not working.

Status
Not open for further replies.
My boss decided to have me translate a program I wrote in C# to work on Macs. Now, he knows that I've never use Objective C, or even a Mac. But I have used MAC addresses, which is a fine substitute.

Anyway, I decided to make a function that I'll need in the program, as part of the learning process. And to do that, I need to call SCNetworkInterfaceCopyAll, which is supposed to be available if I just write "#import <SystemConfiguration/SystemConfiguration.h>". SUPPOSED.

Where is it for real? Could you post a code snippet that calls it and has it work?
 

topham

Ars Legatus Legionis
13,756
Subscriptor
Tiiba":355k3wmy said:
My boss decided to have me translate a program I wrote in C# to work on Macs. Now, he knows that I've never use Objective C, or even a Mac. But I have used MAC addresses, which is a fine substitute.

Anyway, I decided to make a function that I'll need in the program, as part of the learning process. And to do that, I need to call SCNetworkInterfaceCopyAll, which is supposed to be available if I just write "#import <SystemConfiguration/SystemConfiguration.h>". SUPPOSED.

Where is it for real? Could you post a code snippet that calls it and has it work?

Add the framework to the project. Including the header does not add the framework
 
Beyotch. Thanks.

I probably should have thought of this.

So I figured out how to get a list of interfaces, and find out their mac addresses (SCNetworkInterfaceGetHardwareAddressString). Great. But how do I find out which one is receiving the bytes when you check your email?

A code snippet said this should work:

Code:
[(NSString*)SCNetworkInterfaceGetBSDName(curInterface) isEqualToString: LocalString(@"kEthernetBSDName")]

But WTF is LocalString?
 
Status
Not open for further replies.