I have a C function heightParameter that is a simple tool that I use in a couple of my UIViewControllers. I am declaring this only in my main implementation of each UIViewController subclass (in the .m) above my other functions, so that I didn't even have to declare it in the header.

For some reason, I'm getting duplicate symbols in every other subclass that I use it in, despite it being implemented privately. It is within the main @implementation @end block for each subclass and shouldn't be seen by anything else, so how is it being seen globally?

有帮助吗?

解决方案

C function names have global scope. Mark it static or make it a method if you want it to be restricted.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top