本文介绍了Swift断言生产应用程序中的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读中的断言部分,看起来像断言与他们的Objective-C对应物非常相似。但是,在作为生产应用程序运行时,我无法在文档中找到有关运行时行为的任何信息。 Objective-C的 NSAssert 承诺永远不会因断言失败而终止生产应用程序。在Swift中是相同的情况吗?

I'm reading the Assertions section in the Swift e-book and it looks like assertions work very similarly to their Objective-C counterparts. However, nowhere in the docs can I find anything about runtime behaviour while running as a production app. Objective-C's NSAssert promises never to terminate a production application as a result of an assertion failure. Is it the same case in Swift?

推荐答案

基于Apple在,我会说在生产环境中会忽略断言。

Based upon the language Apple use in their documentation, I'd say assertions are ignored in a production environment.

在注意块中:

这篇关于Swift断言生产应用程序中的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 01:22