Jay Hu
Jay Hu

Reputation: 6091

Objective-C syntax: <>

@interface A : B<C>
@interface ViewController : UIViewController<MSBClientManagerDelegate>

So I guess I get A is subclass of B, and B is superclass of A, but what's the relationship between B and C?

Upvotes: 1

Views: 48

Answers (3)

Tim
Tim

Reputation: 4813

As C is a protocol so A conforms to protocol C.

Upvotes: 0

maiconpeixinho
maiconpeixinho

Reputation: 191

C is a protocol that defines a set of methods and or properties that a class must implement and/or can implement if it is defined as optional.

Upvotes: 0

Logan
Logan

Reputation: 53112

In your example above, C is a protocol. What you're saying in english terms is:

I want a class A that subclasses from class B and also conforms to protocol C.

A protocol is similar to an abstract class in other languages and usually defines a set of methods and or properties that a class must implement in order to conform.

Upvotes: 5

Related Questions