displaying mac address in right format

Posted by califguy on Stack Overflow See other posts from Stack Overflow or by califguy
Published on 2010-03-17T03:30:08Z Indexed on 2010/03/17 3:41 UTC
Read the original article Hit count: 217

Filed under:

Hi, I am obtaining the mac(hw) address of an interface using CWNetwork. Now OS X gives me this mac address in the xx:xx:xx:xx:xx:xx format. But if the first digit is 0, OS X will output the address as 4:aa:dd:ee:34:40, instead of 04:aa:dd:ee:34:40.

Now I am trying to take this string 4:aa:dd:ee:34:40 and convert it to 04:aa:dd:ee:34:40 before displaying it. Any ideas ? APpreciate the help.

© Stack Overflow or respective owner

Related posts about cocoa