• 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: Sorry for another NEWBIE question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorry for another NEWBIE question


  • Subject: Re: Sorry for another NEWBIE question
  • From: Cameron Hayne <email@hidden>
  • Date: Wed, 19 Nov 2003 13:35:11 -0500

On 19/11/03 12:28 PM, "Michael Becker" <email@hidden> wrote:

> As my application develops, my AppController class files grow bigger
> and bigger. Usually I would try to divide the appropriate stuff up into
> appropriate files, but it seems as though common standard in Cocoa is
> to use the main controller file for anything.

One thing you can do is use categories to split things up into separate
files. E.g. something like this:

File myController.m:
@implementation myController
// [snip]
@end

File myTableStuff.m:
@implementation myController (myTableStuff)
// [snip]
@end

All methods you put into the category will be available as if they had been
in the main controller file.
I think the first place I saw this trick was in Michael Beam's O'Reilly
article on toolbars:
http://www.macdevcenter.com/pub/a/mac/2002/03/15/cocoa.html

--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.

References: 
 >Sorry for another NEWBIE question (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: Xcode trouble with localization
  • Next by Date: RE: Sorry for another NEWBIE question
  • Previous by thread: Re: Sorry for another NEWBIE question
  • Next by thread: RE: Sorry for another NEWBIE question
  • Index(es):
    • Date
    • Thread