Re: Organizing .h and .m files.
Re: Organizing .h and .m files.
- Subject: Re: Organizing .h and .m files.
- From: Nelson Santos <email@hidden>
- Date: Fri, 5 Oct 2007 17:23:48 -0400
Yikes. This is starting to wander a little too much into the "not
simple" category. :)
On Oct 5, 2007, at 4:35 PM, glenn andreas wrote:
On Oct 5, 2007, at 3:18 PM, Greg Guerin wrote:
Nelson Santos wrote:
Yeah, I know. But I didn't want to add a whole library if I only
wanted one of the classes included in my app.
If you create your static library from multiple translation units,
then
when you link to it, only the units you actually use will be
pulled into
your executable. Static libs aren't necessarily monolithic all-or-
none
constructions. A typical static lib is an "archive" of separately
linkable
object-files, usually arranged in dependency order for single-pass
symbol
resolving.
Note that this is, at best, problematic with Objective-C.
Basically you need to link static libraries with a flag telling the
linker to pull everything Objective-C related in, because it has no
good way to figure out exactly what methods/classes are going to be
referenced and which ones aren't. For example, if you declare a
category on NSString, how is the linker going to know if you need
it or not? Just because your code includes a selector "foo"
doesn't mean that it will call the method foo on an NSString, as
opposed to foo on something else...
For the same reason, it's not practical to try to do dead code
stripping on Objective-C methods...
_______________________________________________
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