Question

I developed my project in xcode and in order to detect the unused imports and statements in my project I opened my project on the "AppCode". The problem which I am facing is that AppCode is only detecting unused import files in .m files of my project, while if I include any unnecessary import statement in .h file the AppCode is not detecting it and that file does not get grey in color.

Can any one please tell me that is there any way of detecting the unused imports statements in .h file of the project if we are using "AppCode" as our IDE?

Was it helpful?

Solution

No, AppCode doesn't show the unused imports in the header files intentionally. Headers might be included in other headers and it's almost impossible to detect the unused imports in the headers. BTW including the headers in other headers is not a good style, it's always better to use predeclarations like @class or @protocol and include the actual headers in the corresponding source files. This approach will produce less dependencies and compilation of the program will be faster.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top