Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the strange problems caused by importing non-OC files

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report