سؤال

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