From Apple documentation: Here
Processing write requests from a connected central element is also simple. When the connected central server sends a request to write the value of one or more of your characteristics, the peripheral manager calls the peripheralManager: didReceiveWriteRequests: method of its delegate object. This time, the delegate method delivers the requests to you in the form of an array containing one or more CBATTRequest objects, each of which represents a write request. After you make sure that the write request can be executed, you can write the value of the characteristics, for example:
myCharacteristic.value = request.value;
Although the above example does not demonstrate this, be sure to consider the query biasing property when writing the value of your attribute.
Just as you respond to a read request, call the responseToRequest: withResult: method exactly once, each time the peripheralManager: didReceiveWriteRequests: delegate method is called. However, the first parameter responseToRequest: withResult: method expects a single CBATTRequest object, even if you may have received an array containing more than one of them from the peripheralManager: didReceiveWriteRequests: delegate method. You must pass the first array request, for example:
[myPeripheralManager respondToRequest:[requests objectAtIndex:0] withResult:CBATTErrorSuccess];
source share