Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: including xibs from another project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: including xibs from another project



> See -all_load and -ObjC gcc man pages.

I've been hit by Roland's issue myself, and have opted to add bogus code to force the class' existence at link time.

My option was to add a bogus (empty) function:
  + (void)_keepAtLinkTime
which I call once somewhere in my code (my point is there no need to allocate anything).

I only have to do this for classes that are only known by the NIB file (quite rare), but I always found it unclean to have code to circumvent an aggressive linker.


Looking at a few threads passing by, it sounds like I might be able to fix it by sending a linker option...

Here is my understanding:
-all_load: This one seems a bit overkill, as all of my unused classes will be kept in the final binary, potentially bloating it.
-ObjC    : This seems to be a compiler flag, and overrides the file extension rules.

But the following page:
  http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Link-Options.html

mentions the following:
===
   -lobjc
      You need this special case of the -l option in order to link an Objective-C or Objective-C++ program.
===
which sounds a bit undocumented as to what exact functionality it provides (compared to -all_load, for instance), but might be just what I need.

Now, I tried finding this setting in Xcode's target settings, but I couldn't find it.

Can somebody enlighten me?... _______________________________________________
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

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.