Difference between release and release then set to nil

前端 未结 5 1804
粉色の甜心
粉色の甜心 2020-12-29 17:14

What is the difference between two snippets?

[myObj release];

and

[myObj release];
myObj = nil;
5条回答
  •  无人及你
    2020-12-29 17:47

    when calling release on object the reference-count is decremented. when calling retain the reference-count is incremented.

    So as the guys mentioned the pointer will still point to the same place.

提交回复
热议问题