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.

Comments

Popular posts from this blog

Subclassing and Signal connect on a same widget crashes PySide application on exit.

Calling OpenCV functions via Cython from Python 3.X.

Showing CPU/Memory usage on tmux status bar(tmuxのステータスバーにCPUとMemoryの使用状況を表示する)