美文网首页
@compatibility_alias

@compatibility_alias

作者: 滴滴时光 | 来源:发表于2021-03-19 11:04 被阅读0次

8.5 compatibility_alias
This is a feature of the Objective-C compiler rather than of the runtime, anyway since it is documented nowhere and its existence was forgotten, we are documenting it here.

The keyword @compatibility_alias allows you to define a class name as equivalent to another class name. For example:

 @compatibility_alias WOApplication GSWApplication;

tells the compiler that each time it encounters WOApplication as a class name, it should replace it with GSWApplication (that is, WOApplication is just an alias for GSWApplication).

There are some constraints on how this can be used—

WOApplication (the alias) must not be an existing class;
GSWApplication (the real class) must be an existing class.

https://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/compatibility_005falias.html

相关文章

网友评论

      本文标题:@compatibility_alias

      本文链接:https://www.haomeiwen.com/subject/wmrvcltx.html