[Biococoa-dev] adding new files

Charles PARNOT charles.parnot at stanford.edu
Mon Mar 14 02:09:46 EST 2005


At 12:05 PM -0500 3/13/05, Koen van der Drift wrote:
>On Mar 13, 2005, at 8:43 AM, Alexander Griekspoor wrote:
>
>>I can't remember why at the time I had to use this approach to make it work, it just was the case. But if the simple import works, yes please change it!
>>
>
>Fixed.
>
>- Koen.

I started the dicussion, so I should clarify what I think happens.

(1) Why do we NEED to remove the relative paths in the public headers? Because when the framework is linked against another application and the person doing this tries to compile her stuff, the headers are parsed by the compiler. But at that moment, all the public headers of the BioCocoa framework are in a flat folder, so relative paths don't make sense. So these relative paths need to be removed in PUBLIC HEADERS, but not necessarily in other places. For example in implementation files, it does not matter. Note that #import in headers are relatively rare: usually for declaring subclasses where you need to load the superclass header. In most cases, @class statements are sufficient.

(2) Why CAN we remove the relative paths and not confuse the compiler when we are compiling the framework itself? My guess (and it is just a guess) is that the compiler first gathers all the public headers to construct the 'Headers' folder in the bundle and these are remembered throughout the compilation (this is even more explicit with the notation <BioCocoa/myheader.h>). However, the gathering will only happen for public headers, and privates headers won't be included (me think). I don't think we have private headers anyway in the framework, but should they appear as more code is added, they might not be #import-ed properly if their path is not included.

charles

-- 
Help science go fast forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford/

Charles Parnot
charles.parnot at stanford.edu

Room  B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)

Tel +1 650 725 7754
Fax +1 650 725 8021



More information about the Biococoa-dev mailing list