iOS Developer Library

Developer

CBMutableDescriptor Class Reference

Options
Deployment Target:

On This Page
Language:

CBMutableDescriptor

CBMutableDescriptor objects represent the descriptors of a local peripheral’s characteristic (local peripheral devices are represented by CBPeripheralManager objects). More...

Inheritance


Conforms To


Import Statement


import CoreBluetooth @import CoreBluetooth;

Availability


Available in iOS 6.0 and later.
  • Returns a newly initialized mutable descriptor with a specified value.

    Declaration

    Swift

    init!(type UUID: CBUUID!, value value: AnyObject!)

    Objective-C

    - (instancetype)initWithType:(CBUUID *)UUID value:(id)value

    Parameters

    UUID

    A 128-bit UUID that identifies the characteristic. You must use only one of the two currently supported descriptor types: CBUUIDCharacteristicUserDescriptionString or CBUUIDCharacteristicFormatString. For more details about these descriptor types, see CBUUID Class Reference.

    value

    The descriptor value to be cached. This value is required (that is, it must not be nil) and cannot be updated dynamically after the descriptor has been published.

    Return Value

    A newly initialized mutable descriptor.

    Discussion

    The value type of value depends on the type of descriptor.

    • The value type of a characteristic user description descriptor (CBUUIDCharacteristicUserDescriptionString) is a string (an instance of NSString) that can be used to provide a human-readable description of the characteristic’s value.

    • The value type of a characteristic format descriptor (CBUUIDCharacteristicFormatString) is an NSData object that can be used to specify how the characteristic’s value should be formatted for presentation purposes.

    If you want to create a local characteristic format descriptor, the descriptor’s value must conform to the attribute value of the characteristic format descriptor as defined in the Bluetooth 4.0 specification, Volume 3, Part G, Section 3.3.3.5 (for more information, see Bluetooth 4.0 Characteristic Presentation Format).

    Import Statement

    import CoreBluetooth

    Availability

    Available in iOS 6.0 and later.