Re: including xibs from another project
Re: including xibs from another project
- Subject: Re: including xibs from another project
- From: Jocelyn Houle <email@hidden>
- Date: Thu, 21 Jan 2010 08:49:26 -0500
On 2010-01-20, at 12:28, Luke Hiesterman wrote:
> From the compilers perspective, the pointer could be absolutely any type - even one that doesn't have an implementation for the given method. Whether the object responds to the selector is a runtime question, not a compile/link time one. The method call is compiled to obj_msgSend or one of it's friends and us linked to libobjc. The assumption that foo is a pointer to any particular object class or group of classes is a big one, and can only be validated at runtime.
The problem at hand comes from a combination of 2 factors:
1) The NIB loading code uses reflection to instantiate some class
2) The linker doesn't see any compiled code using said class, so optimizes it out (unless -all_load is used)
Technically, this is sound.
But practically, it's quite unfortunate. Especially since understanding the reason for a missing symbol requires some knowledge of rather advanced aspects (namely, use of reflection and linker optimizations).
The good news is this is only a problem for static libraries (dynamic ones are linked differently, and inherently retain all of their "unused" classes). The bad news is some recent [popular] platform only allow static libraries.
I wonder if it could make sense to provide a sort of whitelist of classes to the linker, so it keeps a little more than it normally does. Since the XIB/NIB files list class names, couldn't Xcode be able to automatically generate such a list, and have the best of both worlds (i.e. unbloated binaries and no undefined symbols)? _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden