This may seem like a really stupid question, but what is the cost of including (actually, calling #import
) a header file in Objective-C? I get tired of constantly including the same headers in various locations, so I decided to simply create a GlobalReferences.h
file that includes several commonly-referenced headers.
Is there any appreciable cost for including references to other files if they aren't even used? My gut tells me "no" as it seems like the linker is just made aware of other files when using #import
, but I wasn't sure if special considerations need to be taken for iPhone development, which is what my project concerns. Any thoughts?