Difference between __weak UIDataType * weakSelf and UIDataType __weak * weakSelf?

I see two different implementations ...

__weak UIDataType *weakSelf = self; 

and

 UIDataType __weak *weakSelf = self; 

But they both work. Is there a difference in what's happening under the hood?

Thank you in advance for your wisdom!

+6
source share
1 answer

There is no difference. Since __weak can only be applied to pointer types on an object, the compiler recognizes that there is only one value that makes sense for all of the following:

 __weak UIDataType *weakSelf; UIDataType __weak *weakSelf; UIDataType * __weak weakSelf; 

The same applies to other property qualifiers ( __strong , __autoreleasing , etc.)

If you prefer reading the technical specifications of programming languages, you can read about it here: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#spelling .

+4
source

All Articles