RE: Cocoa and dead-code stripping
RE: Cocoa and dead-code stripping
- Subject: RE: Cocoa and dead-code stripping
- From: Jeff Laing <email@hidden>
- Date: Wed, 4 Jul 2007 10:37:58 +1000
> Telling used and unused code apart is straightforward unless
> non-standard method calls are employed (e.g. selectors
> constructed from Strings).
Try writing a plug-in based app (like Photoshop would be if twere in Cocoa)
that passes a "host" object to the things it loads from the plugin. None of
the methods on the services object need be used within the main app, and
thus get dead-stripped. Then the plugin tries to load and fails.
No non-standard method calls required.
Code-flow analysis is non-viable. You can't see that in the PLUGIN's Nib,
it has a connection to File Owner which allows it to know about the methods
provided by the host object.
You fall back to assuming that anything that loads a nib *might* be
providing services to the things inside it, whose makeup you cannot
determine. In fact, the plugin might even be the only place where you
instantiate specific classes that you define in the host application, which
would otherwise presumably be completely stripped away.
_______________________________________________
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