Xcode 显示一些警告

Xcode is showing some warnings

我是 iOS 开发的新手。我想知道一些事情: 我的 Xcode 在我的代码中显示了一些警告。这些警告属于第三方库。 如果代码中的警告很少,Apple 商店会拒绝我的应用程序吗??

这个答案做出了一个关键假设,即您正在使用 Cocoapods,因为您提到了第三方库。如果不是这种情况,请忽略此内容。

正如@rmaddy 所指出的,已弃用的库可能包含 Apple 告诉您的代码 "this works now, but it may stop working at some point in the future or behave in ways we cannot guarantee will be good"。话虽如此,您可以自由提交包含您可以生成的所有警告的应用程序。

综上所述,您可以通过将以下行添加到 Podfile.

来消除这些警告

inhibit_all_warnings!

将此行添加到 Podfile 的顶部,然后重新运行 pod install.

这告诉 Xcode 忽略库生成的 所有 警告。

现在是免责声明部分。

You ignore these warnings at your own peril. Xcode is doing its best to warn you of potentially bad things, but some times you just have to use a library for some reason (I can think of some major projects from well known tech companies) and that library is riddled with warnings. Using the above statement can maintain sanity by dismissing warnings that I frankly cannot do anything about.