I am trying to figure out a way to use typeof to create a weak reference to self for use in blocks to avoid retain cycles.
When I first rea
The correct way to do this is
__weak ActualClassName* weakSelf = self;
Macros only make it unclear what the variable actually is, and what you're actually doing with it, in addition to adding non-portable meta-language to your code.
If you need a more generic version of the class than ActualClassName provides, you aren't dealing with self anymore, since where self is defined, so is the class of self defined.
In those cases, you should use the closest base class name in your inheritance tree, NSObject or better, never id, e.g.
__weak MyBaseClassName* weakObject = object;