ios - why use the "autorelesspool" to define a macro ?
大家讲道理
大家讲道理 2017-04-17 16:59:29
0
1
689
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
刘奇

The purpose of defining a macro like this is to add an @ symbol when using it, because the usage of autoreleaasepool is like this:

@autoreleasepool {
}

So using this trick when defining macros will allow you to use it like this when using macros

@weakify(self),
@strongify(self),

As for the redundant @autoreleasepool {}@try {} @finally {}code introduced by the macro definition, it will be optimized away by the compiler because it does nothing, so it will not have an impact on the final generated code.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template