Quote:
Originally Posted by slaterjohn
In an app im developing i intend to have a very large function that will build a series of arrays. Because of its size i want to be able to store this function in an external file.
Similar to PHP's include file where you can "include" a file at a specific point in an application and the code would be executed as if it was local to the main file.
I noticed there is a #include available but i'm not sure it does what i expect.
I may be looking to do something impossible here or overlooking something very obvious so any help would be much appreciated.
Regards, John
|
Are you trying to include multiple source files at compile-time, or are you trying to invoke a compiled code library at run-time? Those are two very different things.
In C, you can use #include or #import to include one source file in another. #import is better, because it is smart about not including the same file more than once.
#import/#include has exactly the same effect as if you copied the entire contents of the included file and pasted in at the location of the #include statement.
Normally you use #import to include the header (.h) files of your project, but you can also #include the body of a method if you want to.