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 __weak
can only apply to pointer-to-object types, the compiler recognizes that there is only one meaning that makes sense for all of the following:
__weak UIDataType *weakSelf;
UIDataType __weak *weakSelf;
UIDataType * __weak weakSelf;
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With