Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Objective-C 宏中使用商业 at 登录?
我知道不建议这样做,但似乎有可能以某种方式?由于libextobjc提供@weakify,@strongify等...
libextobjc
@weakify
@strongify
libextobjc使用预处理器诡计让你认为它是一个@command.
@command
#define weakify(...) \ try {} @finally {} \ metamacro_foreach_cxt(ext_weakify_,, __weak, __VA_ARGS__)
请注意@. try所以@weakify扩展为@try {} @finally {} [injected code].
@
try
@try {} @finally {} [injected code]
您可以使用相同的技巧,但我建议您坚持使用普通宏。