NordicSemiconductor / IOS-CoreBluetooth-Mock

Mocking library for CoreBluetooth framework.
BSD 3-Clause "New" or "Revised" License
226 stars 51 forks source link

Fixes for Xcode 12.5 beta #31

Closed mmllr closed 3 years ago

mmllr commented 3 years ago

Signed-off-by: Markus Müller markus.mueller@kf-interactive.com

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Markus Müller seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

philips77 commented 3 years ago

Hello, May I know the reason for creating CBMPeer and CBMAttribute classes with fatalError()?

mmllr commented 3 years ago

Hi, Xcode 12.5 beta complains about an unavailable -init() for these classes (hard error, in contrast to earlier Xcode versions, subclassing them is forbidden anyway).

CB_EXTERN_CLASS @interface CBPeer : NSObject <NSCopying>

- (instancetype)init NS_UNAVAILABLE;
...
CB_EXTERN_CLASS @interface CBAttribute : NSObject

- (instancetype)init NS_UNAVAILABLE;

My PR is just a quick fix for getting back to a successful compile. All the CBM classes which use CBMAttribute and CBMPeer overwrite the fatalError implementations.

draskovits commented 3 years ago

Xcode 12.5 has been released and this issue is still relevant. Are there any plans to release this fix?

philips77 commented 3 years ago

Oh, sorry, I completely forgot about this issue. Let me look into it now.

moweex commented 3 years ago

any updates about this PR?

philips77 commented 3 years ago

I'll merge and release it asap. Just give me few hours to finish my current tasks.

lucasderraugh commented 3 years ago

To be clear, this would completely break the functionality of these classes, no?

philips77 commented 3 years ago

If you're using CBMPeripheral or CBMCentralManager, or the original names but as typealias nothing should change. It's only if you were using the CBPeer and CBAttribute types directly, now they are not compatible with CBM.. counterparts.

mmllr commented 3 years ago

Yep, it should not break existing code.

philips77 commented 3 years ago

Released as 0.12.1.