__typeof(self)
is good for portability, since it's not binded to a specific class, nonetheless the &*
trick looks definitely redundant. As far as my knowledge goes, in C
, and consequently Objective-C
, &*ptr
is totally equivalent to ptr
.
However, this may not hold true in other C-like languages such as C++
, since operators can be overloaded and the semantic might not be as straightforward as it looks. In fact I've seen that &*
already in C++
applications, especially when dealing with iterators. My guess here is that the author has a C++
background and that's why he inserted that redundant construct.
Anyway, I may be wrong and I'd love to hear a more sophisticated explanation, it there's any.