Note to self: “@protocol” in Objective-C is like an implementable “interface” in AS3.0 or Java

Here’s a quick example. Perhaps, before trying to decipher the grey code boxes, scroll down a bit to this section:

  • The protocol specification is quite simple. it is basically @protocol ProtocolName (methods you must implement) @end.
  • To conform to a protocol, you put the protocols you’re conforming to in <>’s, and comma separate them. Example: @interface SomeClass <Protocol1, Protocol2, Protocol3>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s