File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ - (bool)isBluetoothLESupported
98
98
99
99
}
100
100
101
- [delegate shouldDisplayAlertTitled: @" Bluetooth LE Support" messageBody: message];
101
+ if ([delegate respondsToSelector: @selector (shouldDisplayAlertTitled:messageBody: )]) {
102
+ [delegate shouldDisplayAlertTitled: @" Bluetooth LE Support" messageBody: message];
103
+ }
102
104
103
105
return NO ;
104
106
}
@@ -184,7 +186,9 @@ - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPe
184
186
if (error.code ) {
185
187
cancelBlock = block;
186
188
187
- [delegate shouldDisplayAlertTitled: @" Peripheral Disconnected with Error" messageBody: error.description];
189
+ if ([delegate respondsToSelector: @selector (shouldDisplayAlertTitled:messageBody: )]) {
190
+ [delegate shouldDisplayAlertTitled: @" Peripheral Disconnected with Error" messageBody: error.description];
191
+ }
188
192
189
193
}
190
194
else
@@ -265,7 +269,9 @@ - (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(C
265
269
{
266
270
NSLog (@" didFailToConnectPeripheral" );
267
271
268
- [delegate shouldDisplayAlertTitled: @" Connect Failed" messageBody: error.description];
272
+ if ([delegate respondsToSelector: @selector (shouldDisplayAlertTitled:messageBody: )]) {
273
+ [delegate shouldDisplayAlertTitled: @" Connect Failed" messageBody: error.description];
274
+ }
269
275
}
270
276
271
277
- (void )centralManager : (CBCentralManager *)central didRetrieveConnectedPeripherals : (NSArray *)peripherals
You can’t perform that action at this time.
0 commit comments