Differences between weak and unsafe_unretained

后端 未结 3 1856
小蘑菇
小蘑菇 2020-12-16 21:00

So I had a project that supported iOS 4, so all my IBOutlets were __unsafe_unretained even IBOutlets that were in the nib but outside the controllers main view

3条回答
  •  执笔经年
    2020-12-16 21:48

    For future searchers who come across this question, I think CRD's Stackoverflow answer to a similar question may explain. Even though the object has been deallocated, the memory that's referenced by the unsafe unretained pointer (which contains the actual object data) is not necessarily zeroed, so things may appear to behave properly until that memory is actually reused/modified/zeroed.

提交回复
热议问题