ios - `-fobjc-arc-exceptions` compiler flag does not have an effect in Xcode for iOS app
问题描述
I am trying to disable the exceptions in the compiler in Xcode 10.1 using -fobjc-arc-exceptions
, but for some reason it does not take effect. My expectation is that the app won't stop running after throwing an exception. E.g.:
@try {
[NSException raise:@"Testing" format:@"details: %@", self];
} @catch (NSException *exception) {
// do some stuff
} @finally {
// do some final stuff and continue as usual
}
Based on http://clang.llvm.org/docs/AutomaticReferenceCounting.html#exceptions , A program may be compiled with the option -fobjc-arc-exceptions in order to enable these, or with the option -fno-objc-arc-exceptions to explicitly disable them, with the last such argument “winning”.
So I tried putting in Build Phases
> Compiler Sources
> all files, or Build Settings
> Other C Flags
, or Other Linker Flags
..
My question is how to properly set this flag, and if my expectation is correct? I do understand that exceptions should not be recovered from.
解决方案
推荐阅读
- ruby-on-rails - 我可以生成一个新的 config/master.key 文件吗?
- python - 通过 python 中的 sqllite 查询传递争论
- c++ - 是否可以在 C++ 中将 double 变量与 int 变量合并?
- excel - 关闭所有 VBE 窗口(MS Access、VB 应用程序)
- python - 附加到数据框字典中的元素
- node.js - 如何通过 id 添加插入对象
- reactjs - React Context - 可以直接从消费者修改提供者上下文吗?
- boost - Boost:无法在 x86 上构建共享库
- greenplum - Greenplum 数据库上的 Vacuumdb 命令被卡住
- powershell - 组合多个 Powershell 脚本