Re: Peripheral dealloced while connecting under ARC?
Re: Peripheral dealloced while connecting under ARC?
- Subject: Re: Peripheral dealloced while connecting under ARC?
- From: Andras Kovi <email@hidden>
- Date: Sat, 09 Mar 2013 09:18:49 +0100
I've also had my rant on this a while ago. For me it was a bigger problem that CBPeripheral does not indicate the connecting and disconnecting states. However, I get a warning/error if I release the peripheral in any of these states. I had to come up with a custom solution, a pretty control layer on top of CB. Maybe once I have some time I'll share it on GitHub.
The problem with requiring the system to retain the peripheral is that once you receive the callback you wouldn't be able to determine which peripheral's interaction initiated the callback. You could say the UUID would be enough. But then having the peripheral stored alongside is not a huge addition. It's annoying and not well documented but can be circumvented easily with some tricks.
Have a nice day,
Andras
On 2013.03.09., at 3:50, Rick Mann <email@hidden> wrote:
>
> On Mar 8, 2013, at 18:35 , Roland King <email@hidden> wrote:
>
>> You have to keep a reference to the peripheral if you want to connect to it.
>
> Thanks, Roland. Any idea why? It seems like, in passing the peripheral to the connect call, the system should keep a reference until the callback (did connect or did fail) returns. Basically, so long as I've started an operation on an object in Core Bluetooth, it should be retained until the callbacks complete.
>
> Otherwise it adds a burden on me to keep track of it, and let go of it if I determine it's not the one I want.
>
>
> --
> Rick
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Bluetooth-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden