在Xcode 11.6中反应本机崩溃

时间:2020-07-29 18:31:31

标签: ios xcode react-native

当我尝试在xcode 11.6中构建应用程序时,出现了此异常,我也不知道在哪里寻找解决方案:
异常NSException *“数据参数为零” 0x00006000014d796​​0。

这是出现的代码:

DISPATCH_NOESCAPE dispatch_block_t block)
{
    if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) {
        dispatch_once(predicate, block); //Exception in this line: Thread 2: Exception: "data parameter is nil"
    } else {
        dispatch_compiler_barrier();
    }
    DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l);
}

enter image description here

1 个答案:

答案 0 :(得分:0)

我确定这现在绝对无关紧要,但我遇到了同样的问题,结果是在传递给 dispatch_once 的块中,抛出了异常,libdispatch 在这种情况下案例中止应用程序。

像这样:

#undef _dispatch_client_callout
void
_dispatch_client_callout(void *ctxt, dispatch_function_t f)
{
    @try {
        return f(ctxt);
    }
    @catch (...) {
        objc_terminate();
    }
}

因此,无论谁遇到类似问题,请检查您的块和它可能抛出的异常。