Supposedly weak is like assign or unsafe_unretained, except that a weak variable is "zeroed" when the object that it points to is dealloc'ed. But ARC is handled by the compiler, so why is weak not supported on iOS 4 and Mac OS X 10.6?
(for this question please don't give a guess as an answer, but something more supported by facts/reference/docs)
Since __weak requires zeroing out one or more pointers in places other than the current object, additional data structures are required to keep track of weak references. This is in contrast to __strong, __unsafe_unretained, and __autoreleasing, which do not require additional tracking. The tracking structures and programs for manipulating them are built into the OS; the compiler inserts the code to perform the calls, but the OS support needs to be there in order for the compiled code to work.
__weak references require runtime support which isn't available on the older iOS versions.
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