How to create a protocol at runtime in Objective-C?

Posted by Jared P on Stack Overflow See other posts from Stack Overflow or by Jared P
Published on 2010-04-11T01:37:40Z Indexed on 2010/04/11 1:43 UTC
Read the original article Hit count: 597

Hi, First of all, I want to be clear that I'm not talking about defining a protocol, and that I understand the concept of

@protocol someprotocol
- (void)method;
@end

I know that the Obj-C runtime allows creation of classes at RUNTIME, as well as its ivars and methods. Also available for creation are SEL-s. I think I'm just missing something, but does anyone know what function to call to create a protocol at runtime? The main reason for this is for conformsToProtocol: to work, so just adding the appropriate methods doesn't really cut it.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about objective-c-runtime