<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/IOBluetoothSDPServiceAttribute/init(id:attributeElementValue:)-84b3r",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)IOBluetoothSDPServiceAttribute(im)initWithID:attributeElementValue:"
  },
  "title" : "init(id:attributeElementValue:)"
}
-->

# init(id:attributeElementValue:)

Initializes a new service attribute with the given ID and element value.

```
init!(id newAttributeID: BluetoothSDPServiceAttributeID, attributeElementValue: NSObject!)
```

## Parameters

`newAttributeID`

The attribute ID of the new service attribute.

`attributeElementValue`

The data element value of the new service attribute

## Return Value

Returns self if successful. Returns nil if there was an error parsing the element value.

## Discussion

See +[IOBluetoothSDPDataElement withElementValue:] for a description of the types that may be passed in as the attributeElementValue.

---

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)