The correct way to define a weak object is:
__typeof__(obj) __weak wobj = obj;
Note that having
__weak before the type is technically incorrect.
However, you can find this in
__weak __typeof(&*self)weakSelf = self;
__typeof__((__typeof__(self))self) trick is not necessary anymore in the clang version Apple clang version
4.0 and later, like Xcode