• 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: including xibs from another project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: including xibs from another project
      • From: lbland <email@hidden>
References: 
 >including xibs from another project (From: Roland King <email@hidden>)
 >Re: including xibs from another project (From: Roland King <email@hidden>)
 >Re: including xibs from another project (From: Mark Woollard <email@hidden>)
 >Re: including xibs from another project (From: Jocelyn Houle <email@hidden>)
 >Re: including xibs from another project (From: Fritz Anderson <email@hidden>)
 >Re: including xibs from another project (From: Roland King <email@hidden>)
 >Re: including xibs from another project (From: Fritz Anderson <email@hidden>)
 >Re: including xibs from another project (From: Roland King <email@hidden>)
 >Re: including xibs from another project (From: Rick Genter <email@hidden>)
 >Re: including xibs from another project (From: Luke the Hiesterman <email@hidden>)
 >Re: including xibs from another project (From: Roland King <email@hidden>)
 >Re: including xibs from another project (From: Luke Hiesterman <email@hidden>)

  • Prev by Date: Re: [moderator] Re: Moderated post on self going out of scope
  • Next by Date: Re: including xibs from another project
  • Previous by thread: Re: including xibs from another project
  • Next by thread: Re: including xibs from another project
  • Index(es):
    • Date
    • Thread