<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/IOBluetoothNSStringToDeviceAddress(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:@F@IOBluetoothNSStringToDeviceAddress"
  },
  "title" : "IOBluetoothNSStringToDeviceAddress(_:_:)"
}
-->

# IOBluetoothNSStringToDeviceAddress(_:_:)

Convenience routine to take an NSString and turn it into a BluetoothDeviceAddress structure.

```
func IOBluetoothNSStringToDeviceAddress(_ inNameString: String!, _ outDeviceAddress: UnsafeMutablePointer<BluetoothDeviceAddress>!) -> IOReturn
```

## Parameters

`inNameString`

Ptr to an NSString that contains the data to turn into the device address.

`outDeviceAddress`

Ptr to an address structure that will be returned.

## Return Value

Returns success (0) or failure code.

## Discussion

Pass in most types of strings, such as “001122334455” or “00-11-22-33-44-55” and the conversion should be successful. Also, you should have 2 characters per byte for the conversion to work properly.

---

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)