How to understand the strange problems caused by importing non-OC files
Today, I will talk to you about how to understand the strange problems caused by the import of non-OC files, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Today, after importing a library file, I suddenly began to report some inexplicable errors.
NSObjCRuntime NSZone NSObject, wait...
At first, I thought that the library file was accidentally corrected by me. I found no problem after setting up an empty project and importing it.
Searching the Internet, I found that a friend and I encountered the same problem and found a solution.
The reason is that when the pch file of the project contains header files globally, I write the import statement outside ifdef _ _ OJBC__, which causes even non-OC files to contain these header files, so the error is reported, and the solution is very simple. Just move the import statement into the ifdefs statement.
Before correction:
After correction:
After reading the above, do you have any further understanding of the strange problems caused by importing non-OC files? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.