When you define properties in a protocol, and register yourself for it later, you need to remember to synthesize it after in the .m file.
So define the protocol here.
Transport.h
@protocol Transport <NSObject> @property (nonatomic, weak) id<TransportDelegate> delegate; @property (nonatomic, assign, readonly) TransportState transportState; @end
Implement it here.
StreamTransport.h
@interface StreamTransport : NSObject<SPTAppRemoteTransport, NSStreamDelegate> @end
And this synthesize it in the .m file here.
StreamTransport.m
@implementation StreamTransport @synthesize delegate = _delegate; @synthesize transportState = _transportState;
You have to do it like this because this is your first change to get your handles on the actual property. So you need to synthesize it manually because you weren’t able to define it like a regularly property previously.
Leave a Reply