title: How do you create a descriptor for a mutable characteristic?
body: <p>The documentation for <code>CBMutableDescriptor:initWithType:value:</code> says to pass a "128-bit UUID that identifies the characteristic" for the type parameter. It then goes on to say you should only use one of <code>CBUUIDCharacteristicUserDescriptionString</code> or <code>CBUUIDCharacteristicFormatString</code> for the type parameter. Finally, there is no method to add a descriptor to a mutable characteristic.</p>
  
  <p>It appears that the parameter is doing two mutually exclusive things. On the one hand, it is being used to tell the O/S which characteristic the descriptor applies to, and on the other, it is being used to set the type of descriptor. The second makes more sense, but then how do you add the descriptor to the characteristic?</p>
  
  <p>Whether you pass the UUID for the characteristic or <code>CBUUIDCharacteristicUserDescriptionString</code>, iOS crashes with</p>
  
  <pre><code>Assertion failure in -[CBMutableDescriptor initWithType:value:], /SourceCache/CoreBluetooth_Sim/CoreBluetooth-59.3/CBDescriptor.m:25
  </code></pre>
  
  <p>What's the correct way to create the CBMutableDescriptor and add it to a CBMutableCharacteristic?</p>