Re: Cocoa and dead-code stripping
Re: Cocoa and dead-code stripping
- Subject: Re: Cocoa and dead-code stripping
- From: Andre Schnoor <email@hidden>
- Date: Tue, 03 Jul 2007 19:39:49 +0200
Andrew Demkin wrote:
On Jul 3, 2007, at 9:54 AM, Clark Cox wrote:
The problem with this is that there is nothing "non-standard" about
constructing selectors from strings. Any Cocoa app that:
loads Nibs,
uses Cocoa Bindings,
uses Core Data,
is implicitly using Key-value coding. KVC depends on being able to
call methods (and lookup instance variables) based on strings that
need not be known at compile time.
Virtually every Cocoa program uses KVC in some way.
There will of course still remain some unused code after the stripping.
No stripper is able to tell which (theoretically) reachable code will
actually be reached during runtime.
And, in Objective-C, the "stripper" would have to assume that *any*
method was reachable (because that is true; every method is
reachable). It could, however, still strip C and C++ functions.
Nib files are part of an Xcode project. Perhaps it's not obvious, but
an automatic stripping tool would be initialized with access to these
resources so they too can be parsed for message selectors (derived
from property names or whatever).
Well, that's a lot easier with Smalltalk, where *everything* is an
object and *all* objects are known to the system at any time. This of
course radically simplifies stripping. Building a similar stripper for
Obj-C would be a troublesome software engineering project to undertake.
Andre
_______________________________________________
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