<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/IOBluetoothSDPDataElement/init(type:sizeDescriptor:size:value:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)IOBluetoothSDPDataElement(im)initWithType:sizeDescriptor:size:value:"
  },
  "title" : "init(type:sizeDescriptor:size:value:)"
}
-->

# init(type:sizeDescriptor:size:value:)

Initializes a new IOBluetoothSDPDataElement with the given attributes.

```
init!(type newType: BluetoothSDPDataElementTypeDescriptor, sizeDescriptor newSizeDescriptor: BluetoothSDPDataElementSizeDescriptor, size newSize: UInt32, value newValue: NSObject!)
```

## Parameters

`newType`

The type descriptor for the data element.

`newSizeDescriptor`

The size descriptor for the data element (verify it matches the size parameter).

`newSize`

The size of the data element in bytes (make sure it is a valid size for the given size descriptor).

`newValue`

The raw value itself. This must be the base NSString, NSNumber, NSArray or NSData objects. It may not be NSDictionary. If a dictionary format is present, use +withElementValue:.

## Return Value

Returns self if successful. Returns nil if an error is encountered (not likely due to the limited error checking currently done).

## Discussion

Warning - be careful using this method. There is next to no error checking done on the attributes. It is entirely possible to construct an invalid data element. It is recommended that +withElementValue: be used instead of this one.

---

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)