self would be strong within a method, allowing the function to complete. Is self weak or strong?
self
is neither strong nor weak in ARC. It is assumed that the caller holds a reference, and self
is unsafe unretained.
It's also true that self
can be -dealloc
ed within its own method under ARC, and it's regarded as "Undefined Behavior (or at least dangerous)" for your program to do this.
What would the reasoning be for it being strong or weak?
It's unretained for Performance -- to avoid what is (in the vast majority of cases) an unnecessary reference count inc/dec. Even if they did all those extra ref count operations, your program would still be susceptible to such problems in multithreaded programs or in the presence of a race condition (also UB). So this is one of those extreme edge cases they (rightly) determined they need not defend themselves from.
Is there documentation on this?