• 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: How to split large class files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to split large class files?


  • Subject: Re: How to split large class files?
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 4 Nov 2007 12:04:45 -0800

On Nov 4, 2007, at 11:37 AM, Arthur C. wrote:
I have a controller class which has become quite large. It has many instance variables which are all related to the view it connects to, and which are manipulated inside the class. Is there a clear way to split such a file into two (or more) components? I considered making a category, but that's not quite good because it cannot have (new) instance variables in it. Moreover, I cannot have the instance var declarations in the original file and the code in the category; that will generate many warnings. Any suggestions? Thanks in advance, Arthur C.

You can certainly have the iVar declarations in the main @interface declaration and references to the ivars in categories without warnings. Works fine. If you are seeing warnings, then something else is hosed.


I'd suggest having a close look at your controller to see if it can't be broken up into multiple classes. Huge source files are usually an indication that something needs to be refactored. Usually. Controller classes are the one class that can sometimes grow quite large.

b.bum

_______________________________________________

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


  • Follow-Ups:
    • Re: How to split large class files?
      • From: Seth Willits <email@hidden>
References: 
 >How to split large class files? (From: Arthur C. <email@hidden>)

  • Prev by Date: How to split large class files?
  • Next by Date: FYI - installer packages are the preferred deployment method now
  • Previous by thread: How to split large class files?
  • Next by thread: Re: How to split large class files?
  • Index(es):
    • Date
    • Thread