Re: Protocols/Distributed Notifications and Compatibility
Re: Protocols/Distributed Notifications and Compatibility
- Subject: Re: Protocols/Distributed Notifications and Compatibility
- From: Andy Lee <email@hidden>
- Date: Sat, 6 Apr 2002 11:01:43 -0500
At 3:08 AM -0800 4/5/02, Sam Goldman wrote:
How do I create a protocol for a Cocoa application. I know that it goes
inside @protocol and @end, but I don't know what to put inside and what it
does. From what I gather from the archives it can be used to send
notifications between the two applications and that is something I want to
do.
"Protocol" in the @protocol/@end sense is not related to "protocol"
in the network communications sense. They're completely different
concepts. Objective-C's @protocol is a language construct and has
nothing to do with communicating between apps, between hosts, or
between languages.
An Objective-C @protocol is a list of method declarations that is
independent of any particular class. When you declare that a class
"conforms to" a protocol, you are promising that the class implements
the methods listed in the protocol. Unrelated classes can conform to
the same protocol.
You should be able to find more info in the Objective-C docs in the
Developer directory. I haven't looked, so if the documentation is
poor or if you have questions about what it says, feel free to ask me
on or off the list. For examples of protocols, you can grep header
files for @protocol, and search the Cocoa class docs for "Protocol".
--Andy
_______________________________________________
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.