@interface Server : NSObject {
id<ServerDelegate> _delegate;
NSInputStream *_inputStream;
NSOutputStream *_outputStream;
}
@property(nonatomic, assign) id<ServerDelegate> delegate;
Whenever I set the delegate of the input or output streams I get a warning that it’s assigning to id from incompatible type Server*.
self.inputStream.delegate = self is an example of this.
The actual server runs fine it’s just the warning that concerns me.
If you want to assign
self(Serverobejct) as the delegate ofNSInputStream, yourServerobject must conform to theNSStreamDelegateprotocol.Since
NSInputStreamis a subclass ofNSStreamhttps://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSStream_Class/Reference/Reference.html#//apple_ref/occ/cl/NSStream