• 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: Cocoa and dead-code stripping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa and dead-code stripping


  • Subject: Re: Cocoa and dead-code stripping
  • From: Andy Lee <email@hidden>
  • Date: Sun, 1 Jul 2007 22:52:03 -0400

On Jul 1, 2007, at 10:31 PM, Steve Christensen wrote:
On Jul 1, 2007, at 7:16 PM, Chris Suter wrote:
For that reason you should isolate your code into different files/ modules as much as possible. You might need to be careful to make sure a file that only has category methods is linked in when required.

So it sounds like, if I want to end up with reasonably-sized code, that I should create just the classes (and methods) that I need for a particular task. When I want to do something similar, it sounds like I should copy the class sources into another target, add some methods, etc., and then compile/link that version?

If by "add some methods" you mean write either a category as Chris suggested or a subclass, then that sounds roughly like an approach that would work. That's what subclasses and categories are for: to help you "isolate your code into different files/modules." I would avoid copying the class file and then adding more methods into that file.


Copying files between projects can quickly become error-prone as your projects get more complex. Wil Shipley wrote an article that suggests how to manage this: <http://www.wilshipley.com/blog/2005/11/ frameworks-are-teh-suck-err.html>. I haven't needed to try this approach myself yet, but I remembered the article because I agreed it seemed like frameworks are a pain to create (Java has us beat there, with easy-to-manage jar files).

--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: 
 >Cocoa and dead-code stripping (From: Steve Christensen <email@hidden>)
 >Re: Cocoa and dead-code stripping (From: Chris Suter <email@hidden>)
 >Re: Cocoa and dead-code stripping (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: Cocoa and dead-code stripping
  • Next by Date: Bluetooth Control
  • Previous by thread: Re: Cocoa and dead-code stripping
  • Next by thread: Re: Cocoa and dead-code stripping
  • Index(es):
    • Date
    • Thread