I’m seeing two different implementations…
__weak UIDataType *weakSelf = self;
and
UIDataType __weak *weakSelf = self;
Yet they both seems to work. Is there a difference in terms of what happens under the hood?
Thanks in advance for your wisdom!
There is no difference. Since
__weakcan only apply to pointer-to-object types, the compiler recognizes that there is only one meaning that makes sense for all of the following:The same applies to the other ownership qualifiers (
__strong,__autoreleasing, etc.)If you’re comfortable reading technical specifications of programming languages, you can read more about it here: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#spelling.