作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
在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/
我是一名优秀的程序员,十分优秀!