Documentation Archive Developer
Search

CoreBluetooth Changes for Objective-C

CoreBluetooth

CBATTRequest.h

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

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

CBCentralManager.h

Removed -[CBCentralManager retrieveConnectedPeripherals]
Removed -[CBCentralManager retrievePeripherals:]
Removed -[CBCentralManagerDelegate centralManager:didRetrieveConnectedPeripherals:]
Removed -[CBCentralManagerDelegate centralManager:didRetrievePeripherals:]
Declaration
From
- (void)connectPeripheral:(CBPeripheral *)peripheral options:(NSDictionary *)options
To
- (void)connectPeripheral:(CBPeripheral * _Nonnull)peripheral options:(NSDictionary<NSString *,id> * _Nullable)options

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

Declaration
From
- (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options
To
- (instancetype _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

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 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 willRestoreState:(NSDictionary *)dict
To
- (void)centralManager:(CBCentralManager * _Nonnull)central willRestoreState:(NSDictionary<NSString *,id> * _Nonnull)dict

CBCharacteristic.h

Removed CBMutableCharacteristic.UUID
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

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

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

CBDescriptor.h

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

CBError.h

CBPeer.h

Removed CBPeer.UUID

CBPeripheral.h

Removed CBPeripheral.isConnected
Declaration
From
@property(weak, 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)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

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

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

CBPeripheralManager.h

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

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

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 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

CBService.h

Removed CBMutableService.isPrimary
Removed CBMutableService.UUID
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
@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

CBUUID.h

Removed CBUUIDAppearanceString
Removed CBUUIDDeviceNameString
Removed CBUUIDGenericAccessProfileString
Removed CBUUIDGenericAttributeProfileString
Removed CBUUIDPeripheralPreferredConnectionParametersString
Removed CBUUIDPeripheralPrivacyFlagString
Removed CBUUIDReconnectionAddressString
Removed CBUUIDServiceChangedString
Deprecation
From--
ToiOS 9.0