• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Protocols and Classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Protocols and Classes (From: "Mike R. Manzano" <email@hidden>)

  • Prev by Date: re: Zero link in deployment build?
  • Next by Date: Re: Linking to a dylib
  • Previous by thread: Protocols and Classes
  • Next by thread: Re: Protocols and Classes
  • Index(es):
    • Date
    • Thread