Pregunta

Objective-C category can implement a protocol. Is the reverse true - can an Objective-C protocol have category?

¿Fue útil?

Solución

No.

A protocol can have @required and @optional methods, which is similar from a compiler point of view (category methods aren't verified by the compiler in the same way normally defined and continuation category methods are).

Protocols can also extend other protocols. For instance, almost any protocol you define yourself should extend <NSObject>.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top