Documentation Archive Developer
Search

CoreBluetooth Changes for Objective-C

CoreBluetooth

CBATTRequest.h

Declaration
From
@property(readonly, retain, nonatomic) CBCentral *central
To
@property(readonly, retain, nonatomic, nonnull) CBCentral *central

Declaration
From
@property(readonly, retain, nonatomic) CBCharacteristic *characteristic
To
@property(readonly, retain, nonatomic, nonnull) CBCharacteristic *characteristic

Declaration
From
@property(readwrite, copy) NSData *value
To
@property(readwrite, copy, nullable) NSData *value

CBCentral.h

Modified CBCentral.identifier
Declaration
From
@property(readonly, nonatomic) NSUUID *identifier
To
@property(readonly, nonatomic, nonnull) NSUUID *identifier

Modified CBCentral.UUID
Declaration
From
@property(readonly, nonatomic) CFUUIDRef UUID
To
@property(readonly, nonatomic, nonnull) CFUUIDRef UUID

CBCentralManager.h

Declaration
From
- (void)cancelPeripheralConnection:(CBPeripheral *)peripheral
To
- (void)cancelPeripheralConnection:(CBPeripheral * _Nonnull)peripheral

Declaration
From
- (void)connectPeripheral:(CBPeripheral *)peripheral options:(NSDictionary *)options
To
- (void)connectPeripheral:(CBPeripheral * _Nonnull)peripheral options:(NSDictionary<NSString *,id> * _Nullable)options

Declaration
From
@property(assign, nonatomic) id<CBCentralManagerDelegate> delegate
To
@property(assign, nonatomic, nullable) id<CBCentralManagerDelegate> delegate

Declaration
From
- (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue
To
- (id _Nonnull)initWithDelegate:(id<CBCentralManagerDelegate> _Nullable)delegate queue:(dispatch_queue_t _Nullable)queue

Declaration
From
- (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options
To
- (id _Nonnull)initWithDelegate:(id<CBCentralManagerDelegate> _Nullable)delegate queue:(dispatch_queue_t _Nullable)queue options:(NSDictionary<NSString *,id> * _Nullable)options

Declaration
From
- (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs
To
- (NSArray<CBPeripheral *> * _Nonnull)retrieveConnectedPeripheralsWithServices:(NSArray<CBUUID *> * _Nonnull)serviceUUIDs

Modified -[CBCentralManager retrievePeripherals:]
Declaration
From
- (void)retrievePeripherals:(NSArray *)peripheralUUIDs
To
- (void)retrievePeripherals:(NSArray * _Nonnull)peripheralUUIDs

Declaration
From
- (NSArray *)retrievePeripheralsWithIdentifiers:(NSArray *)identifiers
To
- (NSArray<CBPeripheral *> * _Nonnull)retrievePeripheralsWithIdentifiers:(NSArray<NSUUID *> * _Nonnull)identifiers

Declaration
From
- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options
To
- (void)scanForPeripheralsWithServices:(NSArray<CBUUID *> * _Nullable)serviceUUIDs options:(NSDictionary<NSString *,id> * _Nullable)options

Declaration
From
- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didConnectPeripheral:(CBPeripheral * _Nonnull)peripheral

Declaration
From
- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didDisconnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error

Declaration
From
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didDiscoverPeripheral:(CBPeripheral * _Nonnull)peripheral advertisementData:(NSDictionary<NSString *,id> * _Nonnull)advertisementData RSSI:(NSNumber * _Nonnull)RSSI

Declaration
From
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didFailToConnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error

Modified -[CBCentralManagerDelegate centralManager:didRetrieveConnectedPeripherals:]
Declaration
From
- (void)centralManager:(CBCentralManager *)central didRetrieveConnectedPeripherals:(NSArray *)peripherals
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didRetrieveConnectedPeripherals:(NSArray<CBPeripheral *> * _Nonnull)peripherals

Modified -[CBCentralManagerDelegate centralManager:didRetrievePeripherals:]
Declaration
From
- (void)centralManager:(CBCentralManager *)central didRetrievePeripherals:(NSArray *)peripherals
To
- (void)centralManager:(CBCentralManager * _Nonnull)central didRetrievePeripherals:(NSArray<CBPeripheral *> * _Nonnull)peripherals

Declaration
From
- (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary *)dict
To
- (void)centralManager:(CBCentralManager * _Nonnull)central willRestoreState:(NSDictionary<NSString *,id> * _Nonnull)dict

Declaration
From
- (void)centralManagerDidUpdateState:(CBCentralManager *)central
To
- (void)centralManagerDidUpdateState:(CBCentralManager * _Nonnull)central

CBCharacteristic.h

Declaration
From
@property(retain, readonly) NSArray *descriptors
To
@property(retain, readonly, nullable) NSArray<CBDescriptor *> *descriptors

Declaration
From
@property(weak, readonly, nonatomic) CBService *service
To
@property(assign, readonly, nonatomic, nonnull) CBService *service

Modified CBCharacteristic.UUID
Declaration
From
@property(readonly, nonatomic) CBUUID *UUID
To
@property(readonly, nonatomic, nonnull) CBUUID *UUID

Declaration
From
@property(retain, readonly) NSData *value
To
@property(retain, readonly, nullable) NSData *value

Declaration
From
@property(retain, readwrite) NSArray *descriptors
To
@property(retain, readwrite, nullable) NSArray<CBDescriptor *> *descriptors

Declaration
From
- (id)initWithType:(CBUUID *)UUID properties:(CBCharacteristicProperties)properties value:(NSData *)value permissions:(CBAttributePermissions)permissions
To
- (id _Nonnull)initWithType:(CBUUID * _Nullable)UUID properties:(CBCharacteristicProperties)properties value:(NSData * _Nullable)value permissions:(CBAttributePermissions)permissions

Declaration
From
@property(retain, readonly) NSArray *subscribedCentrals
To
@property(retain, readonly, nullable) NSArray<CBCentral *> *subscribedCentrals

Modified CBMutableCharacteristic.UUID
Declaration
From
@property(retain, readwrite, nonatomic) CBUUID *UUID
To
@property(retain, readwrite, nonatomic, nullable) CBUUID *UUID

Declaration
From
@property(retain, readwrite) NSData *value
To
@property(retain, readwrite, nullable) NSData *value

CBDescriptor.h

Declaration
From
@property(weak, readonly, nonatomic) CBCharacteristic *characteristic
To
@property(assign, readonly, nonatomic, nonnull) CBCharacteristic *characteristic

Modified CBDescriptor.UUID
Declaration
From
@property(readonly, nonatomic) CBUUID *UUID
To
@property(readonly, nonatomic, nonnull) CBUUID *UUID

Declaration
From
@property(retain, readonly) id value
To
@property(retain, readonly, nullable) id value

Declaration
From
- (id)initWithType:(CBUUID *)UUID value:(id)value
To
- (id _Nonnull)initWithType:(CBUUID * _Nonnull)UUID value:(id _Nullable)value

CBError.h

Added CBErrorMaxConnection

CBPeripheral.h

Declaration
From
@property(assign, nonatomic) id<CBPeripheralDelegate> delegate
To
@property(assign, nonatomic, nullable) id<CBPeripheralDelegate> delegate

Declaration
From
- (void)discoverCharacteristics:(NSArray *)characteristicUUIDs forService:(CBService *)service
To
- (void)discoverCharacteristics:(NSArray<CBUUID *> * _Nullable)characteristicUUIDs forService:(CBService * _Nonnull)service

Declaration
From
- (void)discoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic
To
- (void)discoverDescriptorsForCharacteristic:(CBCharacteristic * _Nonnull)characteristic

Declaration
From
- (void)discoverIncludedServices:(NSArray *)includedServiceUUIDs forService:(CBService *)service
To
- (void)discoverIncludedServices:(NSArray<CBUUID *> * _Nullable)includedServiceUUIDs forService:(CBService * _Nonnull)service

Declaration
From
- (void)discoverServices:(NSArray *)serviceUUIDs
To
- (void)discoverServices:(NSArray<CBUUID *> * _Nullable)serviceUUIDs

Modified CBPeripheral.identifier
Declaration
From
@property(readonly, nonatomic) NSUUID *identifier
To
@property(readonly, nonatomic, nonnull) NSUUID *identifier

Declaration
From
@property(retain, readonly) NSString *name
To
@property(retain, readonly, nullable) NSString *name

Declaration
From
- (void)readValueForCharacteristic:(CBCharacteristic *)characteristic
To
- (void)readValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic

Declaration
From
- (void)readValueForDescriptor:(CBDescriptor *)descriptor
To
- (void)readValueForDescriptor:(CBDescriptor * _Nonnull)descriptor

Declaration
From
@property(retain, readonly) NSNumber *RSSI
To
@property(retain, readonly, nullable) NSNumber *RSSI

Declaration
From
@property(retain, readonly) NSArray *services
To
@property(retain, readonly, nullable) NSArray<CBService *> *services

Declaration
From
- (void)setNotifyValue:(BOOL)enabled forCharacteristic:(CBCharacteristic *)characteristic
To
- (void)setNotifyValue:(BOOL)enabled forCharacteristic:(CBCharacteristic * _Nonnull)characteristic

Modified CBPeripheral.UUID
Declaration
From
@property(readonly, nonatomic) CFUUIDRef UUID
To
@property(readonly, nonatomic, nonnull) CFUUIDRef UUID

Declaration
From
- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type
To
- (void)writeValue:(NSData * _Nonnull)data forCharacteristic:(CBCharacteristic * _Nonnull)characteristic type:(CBCharacteristicWriteType)type

Declaration
From
- (void)writeValue:(NSData *)data forDescriptor:(CBDescriptor *)descriptor
To
- (void)writeValue:(NSData * _Nonnull)data forDescriptor:(CBDescriptor * _Nonnull)descriptor

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverCharacteristicsForService:(CBService * _Nonnull)service error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverIncludedServicesForService:(CBService *)service error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverIncludedServicesForService:(CBService * _Nonnull)service error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverServices:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didModifyServices:(NSArray *)invalidatedServices
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didModifyServices:(NSArray<CBService *> * _Nonnull)invalidatedServices

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateValueForDescriptor:(CBDescriptor * _Nonnull)descriptor error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didWriteValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error

Declaration
From
- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error
To
- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didWriteValueForDescriptor:(CBDescriptor * _Nonnull)descriptor error:(NSError * _Nullable)error

Declaration
From
- (void)peripheralDidUpdateName:(CBPeripheral *)peripheral
To
- (void)peripheralDidUpdateName:(CBPeripheral * _Nonnull)peripheral

Declaration
From
- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)error
To
- (void)peripheralDidUpdateRSSI:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error

CBPeripheralManager.h

Declaration
From
- (void)addService:(CBMutableService *)service
To
- (void)addService:(CBMutableService * _Nonnull)service

Declaration
From
@property(assign, nonatomic) id<CBPeripheralManagerDelegate> delegate
To
@property(assign, nonatomic, nullable) id<CBPeripheralManagerDelegate> delegate

Declaration
From
- (id)initWithDelegate:(id<CBPeripheralManagerDelegate>)delegate queue:(dispatch_queue_t)queue
To
- (id _Nonnull)initWithDelegate:(id<CBPeripheralManagerDelegate> _Nullable)delegate queue:(dispatch_queue_t _Nullable)queue

Declaration
From
- (id)initWithDelegate:(id<CBPeripheralManagerDelegate>)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options
To
- (id _Nonnull)initWithDelegate:(id<CBPeripheralManagerDelegate> _Nullable)delegate queue:(dispatch_queue_t _Nullable)queue options:(NSDictionary<NSString *,id> * _Nullable)options

Declaration
From
- (void)removeService:(CBMutableService *)service
To
- (void)removeService:(CBMutableService * _Nonnull)service

Declaration
From
- (void)respondToRequest:(CBATTRequest *)request withResult:(CBATTError)result
To
- (void)respondToRequest:(CBATTRequest * _Nonnull)request withResult:(CBATTError)result

Declaration
From
- (void)setDesiredConnectionLatency:(CBPeripheralManagerConnectionLatency)latency forCentral:(CBCentral *)central
To
- (void)setDesiredConnectionLatency:(CBPeripheralManagerConnectionLatency)latency forCentral:(CBCentral * _Nonnull)central

Declaration
From
- (void)startAdvertising:(NSDictionary *)advertisementData
To
- (void)startAdvertising:(NSDictionary<NSString *,id> * _Nullable)advertisementData

Declaration
From
- (BOOL)updateValue:(NSData *)value forCharacteristic:(CBMutableCharacteristic *)characteristic onSubscribedCentrals:(NSArray *)centrals
To
- (BOOL)updateValue:(NSData * _Nonnull)value forCharacteristic:(CBMutableCharacteristic * _Nonnull)characteristic onSubscribedCentrals:(NSArray<CBCentral *> * _Nullable)centrals

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didSubscribeToCharacteristic:(CBCharacteristic *)characteristic
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral central:(CBCentral * _Nonnull)central didSubscribeToCharacteristic:(CBCharacteristic * _Nonnull)characteristic

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral central:(CBCentral * _Nonnull)central didUnsubscribeFromCharacteristic:(CBCharacteristic * _Nonnull)characteristic

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral didAddService:(CBService * _Nonnull)service error:(NSError * _Nullable)error

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral didReceiveReadRequest:(CBATTRequest * _Nonnull)request

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray *)requests
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral didReceiveWriteRequests:(NSArray<CBATTRequest *> * _Nonnull)requests

Declaration
From
- (void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary *)dict
To
- (void)peripheralManager:(CBPeripheralManager * _Nonnull)peripheral willRestoreState:(NSDictionary<NSString *,id> * _Nonnull)dict

Declaration
From
- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(NSError *)error
To
- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager * _Nonnull)peripheral error:(NSError * _Nullable)error

Declaration
From
- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral
To
- (void)peripheralManagerDidUpdateState:(CBPeripheralManager * _Nonnull)peripheral

Declaration
From
- (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager *)peripheral
To
- (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager * _Nonnull)peripheral

CBService.h

Declaration
From
@property(retain, readwrite) NSArray *characteristics
To
@property(retain, readwrite, nullable) NSArray<CBCharacteristic *> *characteristics

Declaration
From
@property(retain, readwrite) NSArray *includedServices
To
@property(retain, readwrite, nullable) NSArray<CBService *> *includedServices

Declaration
From
- (id)initWithType:(CBUUID *)UUID primary:(BOOL)isPrimary
To
- (id _Nonnull)initWithType:(CBUUID * _Nullable)UUID primary:(BOOL)isPrimary

Modified CBMutableService.UUID
Declaration
From
@property(retain, readwrite, nonatomic) CBUUID *UUID
To
@property(retain, readwrite, nonatomic, nullable) CBUUID *UUID

Declaration
From
@property(retain, readonly) NSArray *characteristics
To
@property(retain, readonly, nullable) NSArray<CBCharacteristic *> *characteristics

Declaration
From
@property(retain, readonly) NSArray *includedServices
To
@property(retain, readonly, nullable) NSArray<CBService *> *includedServices

Declaration
From
@property(weak, readonly, nonatomic) CBPeripheral *peripheral
To
@property(assign, readonly, nonatomic, nonnull) CBPeripheral *peripheral

Modified CBService.UUID
Declaration
From
@property(readonly, nonatomic) CBUUID *UUID
To
@property(readonly, nonatomic, nonnull) CBUUID *UUID

CBUUID.h

Added CBUUIDValidRangeString
Modified CBUUID.data
Declaration
From
@property(nonatomic, readonly) NSData *data
To
@property(nonatomic, readonly, nonnull) NSData *data

Declaration
From
@property(nonatomic, readonly) NSString *UUIDString
To
@property(nonatomic, readonly, nonnull) NSString *UUIDString

Declaration
From
+ (CBUUID *)UUIDWithCFUUID:(CFUUIDRef)theUUID
To
+ (CBUUID * _Nonnull)UUIDWithCFUUID:(CFUUIDRef _Nonnull)theUUID

Declaration
From
+ (CBUUID *)UUIDWithData:(NSData *)theData
To
+ (CBUUID * _Nonnull)UUIDWithData:(NSData * _Nonnull)theData

Declaration
From
+ (CBUUID *)UUIDWithNSUUID:(NSUUID *)theUUID
To
+ (CBUUID * _Nonnull)UUIDWithNSUUID:(NSUUID * _Nonnull)theUUID

Declaration
From
+ (CBUUID *)UUIDWithString:(NSString *)theString
To
+ (CBUUID * _Nonnull)UUIDWithString:(NSString * _Nonnull)theString