• 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: Toolbar code in separate Controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toolbar code in separate Controller?


  • Subject: Re: Toolbar code in separate Controller?
  • From: Andy Lee <email@hidden>
  • Date: Tue, 15 Jul 2008 11:26:19 -0400

On Jul 15, 2008, at 9:13 AM, John Love wrote:
To tell you the truth, I *really* prefer calling a category an extension
because "extension" just sounds more meaningful to me. Or, maybe just
plain, ole, generic "addition". "Category" just sounds like "type of" or a
sub-class, but it's not that at all.


Yes, we're discussing words, but words are important .. Look up "category"
in a dictionary where it talks about classification. To me, classification
means sub-class.

The normal English meaning of "category" applies to the methods, not the object. For example, a controller class might have a bunch of accessor methods and a bunch of action methods. I think of each of those bunches as categories of methods. When you extend a class with a "category" in the Objective-C sense, you're typically creating a logical "bunch." You typically use a logical name for the bunch as the name of your category.


Grepping for category declarations in, say, Foundation shows how category names identify logical grouping of methods:

% cd /System/Library/Frameworks/Foundation.framework/Headers
% grep @interface *.h | grep "("
NSArchiver.h:@interface NSObject (NSArchiverCallback)
NSArray.h:@interface NSArray (NSExtendedArray)
NSArray.h:@interface NSArray (NSArrayCreation)
NSArray.h:@interface NSMutableArray (NSExtendedMutableArray)
NSArray.h:@interface NSMutableArray (NSMutableArrayCreation)
NSAttributedString.h:@interface NSAttributedString (NSExtendedAttributedString)
NSAttributedString.h:@interface NSMutableAttributedString (NSExtendedMutableAttributedString)
NSCalendarDate.h:@interface NSDate (NSCalendarDateExtras)
NSCalendarDate.h:@interface NSDate (NSNaturalLangage)
...(a hundred or so more)...


--Andy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Uli Kusterer <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Graham Cox <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: "John Love" <email@hidden>)

  • Prev by Date: Re: iPhone: Implementing search and index combo, like Contacts?
  • Next by Date: Re: [Q] Any document that shows differences of Cocoa, programmiing for Mac and for the iPhone/iPod touch?
  • Previous by thread: Re: Toolbar code in separate Controller?
  • Next by thread: Bit maps from raw camera files
  • Index(es):
    • Date
    • Thread