• 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: @interface MyController for ThumbnailMatrix.h? Why? Confused?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @interface MyController for ThumbnailMatrix.h? Why? Confused?


  • Subject: Re: @interface MyController for ThumbnailMatrix.h? Why? Confused?
  • From: Andy Lee <email@hidden>
  • Date: Sun, 16 Jan 2005 20:27:58 -0500

On Jan 16, 2005, at 8:03 PM, James Andrews wrote:
@interface MyController (ThumbnailMatrix)

I don't understand why the interface is called "MyController
(ThumbnailMatrix)" instead of just ThumbnailMatrix.  What does this
do, and why would it be done?

You are looking at the declaration of a category, not a class. A category is a way of adding methods to a class separately from the main class declaration. The main reasons to do this are:


* to extend the behavior of a class you don't have source for,

* to group methods into logical bunches if your class has a lot of them, or

* to declare what's called an "informal protocol."

Another reason would be if you want to determine the behavior of your class at runtime -- you could load the appropriate bundle containing the category.

To read up on categories, you could start here:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ LanguageOverview/chapter_3_section_7.html#//apple_ref/doc/uid/20001424/ TPXREF139>

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >@interface MyController for ThumbnailMatrix.h? Why? Confused? (From: James Andrews <email@hidden>)

  • Prev by Date: Re: @interface MyController for ThumbnailMatrix.h? Why? Confused?
  • Next by Date: Debugging blocking
  • Previous by thread: Re: @interface MyController for ThumbnailMatrix.h? Why? Confused?
  • Next by thread: Debugging blocking
  • Index(es):
    • Date
    • Thread