Question

I'm extending the NameAndPassword example (https://github.com/skycocker/NameAndPassword) and I need to acces IOBluetooth methods in this implementation file: https://github.com/skycocker/NameAndPassword/blob/master/NameAndPasswordPlugin.m

The interface looks like this:

@interface EXNameAndPassword : SFAuthorizationPluginView 

How do I make it inherit from CBCentralManagerDelegate like in appdelegate:

@interface AppDelegate : NSObject <CBCentralManagerDelegate, CBPeripheralDelegate>

I need EXNameAndPassword to inherit both from SFAuthorizationPluginView and CBCentralManagerDelegate and stuff. I believe this is quite easy, I'm just an obj-c beginner. I read about composition but I can't get it to work.

What I have currently is

 @interface EXNameAndPassword : SFAuthorizationPluginView <CBCentralManagerDelegate, CBPeripheralDelegate>

but I keep getting warnings about properties non synthesized -- I didn't have to synthesize them in my project which didn't require SFAuthorizationPluginView inheritance, therefore I guess I'm doing something wrong.

Was it helpful?

Solution 2

I got the problem.

@interface EXNameAndPassword : SFAuthorizationPluginView <CBCentralManagerDelegate, CBPeripheralDelegate> 

is perfectly fine, I just had to disable architectures other than x86_64 in build settings.

Source: http://www.cocoabuilder.com/archive/cocoa/198573-property-problem.html

OTHER TIPS

the "properties non synthesised" warning is related to properties defined in a protocol.

In a class @properties are automatically @synthesized in the implementation, but in a protocol, it is the conforming class's responsibility to synthesize, so add:

@synthesize protocolPropertyName = _protocolPropertyName;

in EXNameAndPassword.m

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top