I know this is a stupid question but here goes.
I have an older app that uses isConnected. Now I get a warning that it is deprecated. Can I just delete this line of code without any ramification or how do I handle this. Sorry for being so dense.
here is some code it is from the CBPeripheral framework.
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error
{
// Deal with errors (if any)
if (error) {
NSLog(@"Error discovering characteristics: %@", [error localizedDescription]);
[self cleanup];
return;
}
}
- (void)cleanup
{
// Don't do anything if we're not connected
if (!self.discoveredPeripheral.isConnected) // here is where the warning comes {
return;
}
I think I found the answer should be
- (void)cleanup
{
// Don't do anything if we're not connected
if (CBPeripheralStateDisconnected) {
return;
}
I also added @property(readonly) CBPeripheralState state; in my .h
I don't get an error Can anyone verify this for me?