• 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: Protocol doesn't seem to compile? (SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Protocol doesn't seem to compile? (SOLVED)


  • Subject: Re: Protocol doesn't seem to compile? (SOLVED)
  • From: Sherm Pendley <email@hidden>
  • Date: Fri, 27 Feb 2004 11:45:36 -0500

On Feb 27, 2004, at 11:31 AM, Jason Vowell wrote:

That is very helpful. I can just declare them in a .h file and include the
in an empty .m file and even take the opportunity to test them in the .m
file if need be (as suggested previously).

It's more than just simple syntax-checking - much more.

Presumably, since you're using formally-declared protocols, your code will need to interface with objects that implements those protocols. You'll need to include the protocol definition in your code then, in order to test those objects with -conformsToProtocol:.

Also, when you're dealing with objects whose class you don't know, but you expect to implement your protocol, you can declare them as id<ProtocolName> to avoid compiler warnings about unknown methods.

sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Open Recent and the User Preferences Database
  • Next by Date: Controller for custom classes
  • Previous by thread: NSWindow.delegate() crashing
  • Next by thread: Controller for custom classes
  • Index(es):
    • Date
    • Thread