Difference between protocol and delegates?

What is the difference between a protocol and a delegate? and, How can we declare variables in a protocol class? Answer A protocol, declared with the (@protocol syntax in Objective-C) is used to declare a set of methods that a class “adopts” (declares that it will use this protocol) will implement. This means that you … Read more

Objective-C Protocol Forward Declarations

ObjectProperties.h @protocol ObjectProperties <NSObject> @property (strong, nonatomic) NSString *name; @property (strong, nonatomic) NSDate *date; @property (assign, nonatomic) int64_t index; @end ClassA.h #import <Foundation/Foundation.h> @protocol ObjectProperties; @interface ClassA : NSObject <ObjectProperties> – (void)specialSauce; @end; ManagedClassA.h #import <CoreData/CoreData.h> @protocol ObjectProperties; @interface ManagedClassA : NSManagedObject <ObjectProperties> – (void)doSomething; @end; From the code example above, I have defined a … Read more

Generate Protobuf documentation? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 4 years ago. Improve this question Does anyone know of a good tool to generate Google Protobuf documentation using the .proto source files? Answer [Update: … Read more

Which protocol? svn:// or http(s)://?

There are four common protocols for network access of SVN. svn://repos svn+ssh://repos https://repos http://repos The Wikipedia page doesn’t say much about the differences of the four different protocols. I’ve always preferred svn://, because it is the easiest to set up, but what is the difference and which one is “better”? Answer http:// has a serious … Read more

Simple serial point-to-point communication protocol

I need a simple communication protocol between two devices (a PC and a microcontroller). The PC must send some commands and parameters to the micro. The micro must transmit an array of bytes (data from sensor). The data must be noise protected (besides parity checking, I think I need some other data correction method). Is … Read more

Cannot find protocol declaration

I have two view controllers A and B, and they both have each other as their delegates. When I did nothing except define the protocols at the beginning of the header files and #import the other’s header file, I got two errors along the lines of – cannot find protocol declaration for “BDelegate”, which was … Read more

Using some protocol as a concrete type conforming to another protocol is not supported

I’m trying to mix generics with protocols and I’m getting a really hard time xD I have certain architecture implemented in an Android/Java project, and I’m trying to rewrite it to fit it in a swift/iOS project. But I’ve found this limitation. ProtocolA protocol ProtocolA { } ProtocolB protocol ProtocolB : ProtocolA { } ImplementProtocolA … Read more