Re: Cocoa and dead-code stripping
Re: Cocoa and dead-code stripping
- Subject: Re: Cocoa and dead-code stripping
- From: Andrew Demkin <email@hidden>
- Date: Tue, 3 Jul 2007 10:04:38 -0700
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).
Andrew
_______________________________________________
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