Edit me

Ideally source files should be motile. One would like to easily move them between various projects without having to edit anything. The modern workflow achieves this with generic header names.

As we saw in the previous chapter, headers and libraries are transparently added and removed to a project with mulle-sde. All the external dependencies are isolated in header files with generic names. Headers belonging to the project do not appear in these files.

include.h Used by C header files
include-private.h Used by C source files
import.h Used by Objective-C interface files
import-private.h Used by Objective-C implementation files

So we can write our source code in a uniform way.



#import "import.h"

@interface Foo : NSObject

and the implementation like so:


#import "Foo.h"

#import "import-private.h"

@implementation Foo


For C its quite the same, but different header files are used.


#include "include.h"

void  foo( void);


#include "foo.h"

#include "include-private.h"

void  foo( void)
   calling( "whatever");


As platform dependent headers and #ifdef definitions are isolated in the generic headers, this is basically all there is to it. Read The beauty of generic header-names for more details on this topic.


The modern workflow uses only static libraries. Static libraries can be unpacked and repackaged. This can be used to good advantage, if we use coverage information to remove all Objective-C classes and categories, that aren’t actually used.