Reputation: 18558
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!
Upvotes: 6
Views: 188
Reputation: 49034
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.
Upvotes: 4