RE: Protocols and Classes
RE: Protocols and Classes
- Subject: RE: Protocols and Classes
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Thu, 6 Nov 2003 19:22:46 -0500
BOOL conformsToProtocol = [MyClass conformsToProtocol:@protocol(pProtocol)];
Check the NSObject docs (and capitalize class names).
I don't think there's a way to get a list of protocols to which a class
conforms.
Jonathan
> -----Original Message-----
> From: email@hidden
> [mailto:email@hidden]On Behalf Of Mike R. Manzano
> Sent: Thursday, November 06, 2003 6:06 PM
> To: xcode-users mailing list
> Subject: Protocols and Classes
>
>
> If I have a class:
>
> Class *myClass = ... ;
>
> How can I determine if myClass adopts a protocol pProtocol?
>
> I know I can get the name of the class using NSStringFromClass(), but
> how about a list of the formal protocols it adopts? Or do I have to
> test to see if it responds to the selectors that I need?
>
>
> Mike R. Manzano - alephx01 (at) mac (dot) com
>
> "It makes me mad when people say I turned and ran like a scared rabbit.
> Maybe it was like an angry rabbit, who was running to go fight in
> another fight, away from the first fight." -- Jack Handey
> _______________________________________________
> xcode-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/xcode-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.