<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZMACAddress/init(string:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZMACAddress(im)initWithString:"
  },
  "title" : "init(string:)"
}
-->

# init(string:)

Creates a MAC address object from a specially formatted string.

```
convenience init?(string: String)
```

## Parameters

`string`

A string that contains the 6 hexadecimal bytes of the MAC address separated by colon characters. An example string is `01:23:45:ab:cd:ef`. The string is case-insensitive, so you may use uppercase or lowercase for alphabetical characters.

## Return Value

A MAC address object with the specified value, or `nil` if the string is formatted incorrectly.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)