Jun 8, 2009

defining constant in .h file in Objective-C

I tried to import .h file defining constant in it, but could not compile, because of redundant defining. So I googled and found a solution.

I should use "extern const" in header file and set value in .m file. (Don't say about precompiler. I don't like #define in religious reason.)

I was thinking a 'const' value work just as a precomiled value and is not affected by linking, but it's not a case with Objective-C. 

... OR is this same to normal c comiler? I should see it.

No comments: