gpt4 book ai didi

objective-c - 有没有办法标记一个不返回的 Objective-C 方法?

转载 作者:搜寻专家 更新时间:2023-10-30 19:47:23 26 4
gpt4 key购买 nike

在clang中,你可以这样标记一个不返回的C函数:

extern void go_die_somewhere( void ) __attribute__((noreturn));

Objective-C 方法是否有等效的属性?

我尝试过将 __attribute__((noreturn)) 添加到方法声明中,但编译器忽略了它。我也找不到任何具有相同目的的 NS_... 宏。

最佳答案

尝试使用 + (void) __attribute__((noreturn)) someMethod here .

关于objective-c - 有没有办法标记一个不返回的 Objective-C 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54316375/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com